Skip to content

Suggest available Jira issues when editing a Merge Request title or description

Problem to solve

Having the ability to quickly select from a list of Jira issues when editing a MR title or description would be a nice QOL improvement.

Related issues

This issue is part of epic to improve the Jira <> Merge Request experience &4637.

Related issues and suggested order of implementation:

  1. Add a project-level toggle to require Jira association in Merge Requests #268294 (closed)
  2. Add Jira ticket association requirement to Merge Requests #268292 (closed)
  3. Add a project-level toggle to require Jira association in Merge Requests #268294 (closed)
  4. This issue

Proposal

  1. When the feature flag is enabled.
  2. And the project has Jira integration.
  3. When a user types in text that matches the an integrated Jira project's code, for example JRE.
    1. Then show an autocomplete dropdown with the Jira ticket numbers and titles.
  4. When a user types in text that matches the start of a Jira ticket, for example JRE-11.
    1. Then show an autocomplete dropdown with the Jira tickets that match the entered text, for example JRE-110, JRE-111.
  5. When a user clicks on a suggestion, insert the Jira ticket reference into the textfield.

A note on Jira ticket formatting. The ticket reference is always in all caps, contains a dash and ends in a number.

Autofill

Implementation

frontend

WIP 🚧

Initial weight estimate 5️⃣ due to unknown complexities in working with Jquery in setting up a new autocomplete dropdown.

  1. Fetch the integrated Jira project references, for example JAT.
  2. Create a new autocomplete matcher for each Jira reference in ee/app/assets/javascripts/gfm_auto_complete.js.
    • Display a list of matching Jira tickets.
  3. Update specs

backend

Requirements for the frontend to function:

  1. The ability to pass a list of integrated Jira project references to the HAML view.
  2. An API to query the matching integrated Jira tickets on a project, input examples: JRA, JRA-12, JRA-123.

TODO: backend engineer to add implementation plan 🚧

Edited by Jiaan Louw