Skip to content

Include Jira issue keys for related MRs

Luke Duncalfe requested to merge 354373-pass-associated-mr-jira-issue-keys into master

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.

#354373 (closed)

Screenshots or screen recordings

Screen shot of branch associated to Jira issue QA steps recording
image Screen_Recording_2023-03-29_at_3.31.43_PM

How to set up and validate locally

  1. Sign up for Jira https://www.atlassian.com/software/jira
  2. Set up a GitLab for Jira app development environment (using GitPod is recommend).
  3. If using GitPod (recommended):
  4. Open port 3000
  5. 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
  6. 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)
  7. Create an issue on Jira and note the Jira issue ID e.g. TEST-123.
  8. On GitLab, create a new branch and an MR that has the Jira issue ID in the title or description.
  9. 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.

Related to #354373 (closed)

Edited by Luke Duncalfe

Merge request reports