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:
- Add a project-level toggle to require Jira association in Merge Requests #268294 (closed)
- Add Jira ticket association requirement to Merge Requests #268292 (closed)
- Add a project-level toggle to require Jira association in Merge Requests #268294 (closed)
- This issue
Proposal
- When the feature flag is enabled.
- And the project has Jira integration.
- When a user types in text that matches the an integrated Jira project's code, for example
JRE
.- Then show an autocomplete dropdown with the Jira ticket numbers and titles.
- When a user types in text that matches the start of a Jira ticket, for example
JRE-11
.- Then show an autocomplete dropdown with the Jira tickets that match the entered text, for example
JRE-110, JRE-111
.
- Then show an autocomplete dropdown with the Jira tickets that match the entered text, for example
- 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.
Implementation
WIP
Initial weight estimate
- Fetch the integrated Jira project references, for example
JAT
. - 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.
- Update specs
Requirements for the frontend to function:
- The ability to pass a list of integrated Jira project references to the HAML view.
- 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