JIRA Integration - prepare link to create issue in Jira with prefilled data from vulnerability
Why are we doing this work
We need to provide a link for the frontend to create new issue in Jira with already prefilled fields for summary, description and issue type. To generate that link we need to first render description with Jira supported syntax so it is formatted in similar way to issue created in GitLab. We need to make sure this link will be available only if user has GitLab Ultimate license.
#8942[b1-details-page-jira-enabled.png]
Relevant links
Non-functional requirements
- [-] Documentation: not needed
-
Feature flag: jira_create_issues_for_vulnerabilities
- return the link only when feature flag is enabled, - [-] Performance:
- [-] Testing:
Implementation plan
-
backend in ee/app/models/project_services/ee/jira_service.rb
add new method to preparenew_issue_url_with_predefined_fields
like:"#{url}/secure/CreateIssueDetails!init.jspa?pid=#{project_id}&issuetype=#{issue_key}&summary=#{summary}&description=#{description}"
and make sure that we are not exceeding the limit of 4000 characters, -
backend in vulnerability_details
method inee/app/helpers/vulnerabilities_helper.rb
add new field to return to frontend with the prefilled link to Jira, -
backend create new description template for Jira issue: vulnerabilities/jira_issue_description.md.erb
using syntax from https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all, initially select only fields that are important and for which we are certain they will not exceed the limit,
Edited by Alan (Maciej) Paruszewski