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
end
def to_param
title.parameterize
'custom_issue_tracker'
end
def fields
......
......@@ -37,7 +37,7 @@ class JiraService < IssueTrackerService
if enabled_in_gitlab_config
self.properties = {
title: issues_tracker['title'],
project_url: issues_tracker['project_url'],
project_url: set_project_url,
issues_url: issues_tracker['issues_url'],
new_issue_url: issues_tracker['new_issue_url']
}
......@@ -56,4 +56,14 @@ class JiraService < IssueTrackerService
def issues_tracker
Gitlab.config.issues_tracker['jira']
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
......@@ -27,7 +27,7 @@ class RedmineService < IssueTrackerService
if enabled_in_gitlab_config
self.properties = {
title: issues_tracker['title'],
project_url: issues_tracker['project_url'],
project_url: set_project_url,
issues_url: issues_tracker['issues_url'],
new_issue_url: issues_tracker['new_issue_url']
}
......@@ -46,4 +46,13 @@ class RedmineService < IssueTrackerService
def issues_tracker
Gitlab.config.issues_tracker['redmine']
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
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