Implement JQL Autocomplete using @atlassianlabs/jql-autocomplete

Hi all,

I want to implement JQL autocomplete functionality exactly like we have have on JIRA in my Angular application. I am able to get the autocomplete and suggestion data that is provided by JIRA’s rest API but i am not able to give suggestions like JIRA provides on it’s UI.

GET /rest/jql/autocompletedata
GET /rest/jql/autocompletedata/suggestions

These APIs dump all the data that is required for suggesting next values to user. But the issue we are facing is properly parsing the string that user has entered. To suggest the next possible value we must map the existing tokens that user has entered already with jql fields, operators, values etc. which is a difficult as Jira JQL does not have any consistent delimiters.

To resolve above issue, I have come across “@atlassianlabs/jql-autocomplete - npm” this package to get autocomplete suggestions as it already using a JQL parser. But the issue with this package is that it does not have all the possible suggestions because I may need to suggest some custom fields as well that I have configured on my JIRA.

So I want to have some custom fields as well in suggestion values. How can I solve this problem ?
Also can anyone please help me to understand proper usage of this package so that I can extend this as per my needs ?

please help.

Hi,

Are you running Angular app in Connect, or Forge?

not connect nor forge. I am using JIRA data center locally and my angular application is running separately on my local. I am using JIRA’s rest APIs to connect and do operations on JIRA.