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

Update new services with initialization based on existing data.

parent 4a38d538876d
......@@ -19,7 +19,7 @@ def description
end
def to_param
title.parameterize
'custom_issue_tracker'
end
def fields
......
......@@ -37,7 +37,7 @@ def initialize_properties
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 @@ def enabled_in_gitlab_config
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 @@ def initialize_properties
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 @@ def enabled_in_gitlab_config
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