How to insert a jql into my jira plugin

I wrote a jira plugin.
Now I want to insert a jql into my jira plugin’s page.Like this


I have no idea about it.

Hi, to initialize a JQL Autocomplete field, you can simply call the global JQLAutoComplete function that is available via window.JIRA.JQLAutoComplete. However, this requires you to add the necessary dependency (jira.webresources:jqlautocomplete) to your webresource.

JIRA.JQLAutoComplete({
    jqlFunctionNames: jqlFunctions,
    parser: JIRA.JQLAutoComplete.MyParser(jqlReservedWords),
    jqlFieldNames: jqlFieldNames,
    autoSelectFirst: false,
    allowArrowCarousel: true,
    queryDelay: 0.85,
    minQueryLength: 2,
    fieldID: `your textarea or text input`,
    errorID: `span or whatever element to display errors`,
});

You can request the available jqlFunctionNames, jqlFieldNames, jqlReservedWords from /rest/api/2/jql/autocompletedata

That must be it.

Best regards

Marc

1 Like