Commit 737f6516 authored by Marin Jankovski's avatar Marin Jankovski

Update new services with initialization based on existing data.

parent e9d6d1e5
...@@ -19,7 +19,7 @@ class CustomIssueTrackerService < IssueTrackerService ...@@ -19,7 +19,7 @@ class CustomIssueTrackerService < IssueTrackerService
end end
def to_param def to_param
title.parameterize 'custom_issue_tracker'
end end
def fields def fields
......
...@@ -37,7 +37,7 @@ class JiraService < IssueTrackerService ...@@ -37,7 +37,7 @@ class JiraService < IssueTrackerService
if enabled_in_gitlab_config if enabled_in_gitlab_config
self.properties = { self.properties = {
title: issues_tracker['title'], title: issues_tracker['title'],
project_url: issues_tracker['project_url'], project_url: set_project_url,
issues_url: issues_tracker['issues_url'], issues_url: issues_tracker['issues_url'],
new_issue_url: issues_tracker['new_issue_url'] new_issue_url: issues_tracker['new_issue_url']
} }
...@@ -56,4 +56,14 @@ class JiraService < IssueTrackerService ...@@ -56,4 +56,14 @@ class JiraService < IssueTrackerService
def issues_tracker def issues_tracker
Gitlab.config.issues_tracker['jira'] Gitlab.config.issues_tracker['jira']
end end
def set_project_url
id = self.project.issues_tracker_id
if id
issues_tracker['project_url'].gsub(":issues_tracker_id", id)
else
issues_tracker['project_url']
end
end
end end
...@@ -27,7 +27,7 @@ class RedmineService < IssueTrackerService ...@@ -27,7 +27,7 @@ class RedmineService < IssueTrackerService
if enabled_in_gitlab_config if enabled_in_gitlab_config
self.properties = { self.properties = {
title: issues_tracker['title'], title: issues_tracker['title'],
project_url: issues_tracker['project_url'], project_url: set_project_url,
issues_url: issues_tracker['issues_url'], issues_url: issues_tracker['issues_url'],
new_issue_url: issues_tracker['new_issue_url'] new_issue_url: issues_tracker['new_issue_url']
} }
...@@ -46,4 +46,13 @@ class RedmineService < IssueTrackerService ...@@ -46,4 +46,13 @@ class RedmineService < IssueTrackerService
def issues_tracker def issues_tracker
Gitlab.config.issues_tracker['redmine'] Gitlab.config.issues_tracker['redmine']
end end
def set_project_url
id = self.project.issue_tracker_id
if id
issues_tracker['project_url'].gsub(":issue_tracker_id", id)
else
issues_tracker['project_url']
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment