JIRA Integration comment template
Description
We have in few of our projects, where the comment section into our JIRA look a bit cluttered and we wanted to simplify it, by adding a custom comment format. Browsing the code however, I see that it's hardcoded currently into:
embedded/service/gitlab-rails/app/models/project_services/jira_service.rb
Here is the snip:
def add_comment(data, issue)
user_name = data[:user][:name]
user_url = data[:user][:url]
entity_name = data[:entity][:name]
entity_url = data[:entity][:url]
entity_title = data[:entity][:title]
project_name = data[:project][:name]
message = "[#{user_name}|#{user_url}] mentioned this issue in [a #{entity_name} of #{project_name}|#{entity_url}]:\n'#{entity_title.chomp}'"
link_title = "GitLab: Mentioned on #{entity_name} - #{entity_title}"
link_props = build_remote_link_props(url: entity_url, title: link_title)
unless comment_exists?(issue, message)
send_message(issue, message, link_props)
end
end
Proposal
It would be great, if there is the ability to define the message section either as configuration or a custom template.