Include Jira issue keys for related MRs
What does this MR do and why?
Our Jira integration will show related GitLab branches when viewing an issue in Jira, but only if the branch names contained the Jira ticket ID specifically (e.g., my-branch-JIRA-1
).
This change will associated GitLab branches with an issue in Jira, if the corresponding merge request title or description references the Jira ticket.
Screenshots or screen recordings
Screen shot of branch associated to Jira issue | QA steps recording |
---|---|
Screen_Recording_2023-03-29_at_3.31.43_PM |
How to set up and validate locally
- Sign up for Jira https://www.atlassian.com/software/jira
- Set up a GitLab for Jira app development environment (using GitPod is recommend).
- If using GitPod (recommended):
- Open port
3000
- Change to this branch, on the GitPod terminal:
bash cd /workspace/gitlab && git fetch origin 354373-pass-associated-mr-jira-issue-keys && git checkout 354373-pass-associated-mr-jira-issue-keys && bundle && yarn && cd /workspace/gitlab-development-kit && gdk restart
- Enable the flag
# If using GitPod, start the rails console from the GitPod terminal: cd /workspace/gitlab && bundle exec rails c
Feature.enable(:jira_include_keys_from_associated_mr_for_branch)
- Create an issue on Jira and note the Jira issue ID e.g.
TEST-123
. - On GitLab, create a new branch and an MR that has the Jira issue ID in the title or description.
- In the Jira sidebar, you should see the branch associated. Sometimes with GitPod, this can be delayed. If it doesn't appear to work after a while, restart GDK:
cd /workspace/gitlab-development-kit && gdk restart
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #354373 (closed)
Edited by Luke Duncalfe