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

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

As part of &7542 we need to suggest Jira tickets to autocomplete on issues and merge requests.

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 weight of 5️⃣ due potential unknowns in working with Jquery autocomplete code.

  1. Fetch the integrated Jira project references from the backend #352498.
  2. Create a new autocomplete matcher for each Jira reference in ee/app/assets/javascripts/gfm_auto_complete.js.
    • Take the user input and query the backend in #352498.
    • Display a list of matching Jira tickets.
  3. Update specs
Edited by 🤖 GitLab Bot 🤖