Javascript module for autocompleting JQL queries in JIRA.


1.0.24 years ago4 years agoMinified + gzip package size for @deviniti/jql-autocomplete in KB



This repository contains a javascript module for autocompleting JQL queries in JIRA.

How do I get set up?

Download the jql-autocomplete.js file and include it in your page.

To enable autocompletion on a selected input field create an autocompletion controller:


var JQLAutocomplete = new JQLAutocomplete(data);

and pass the parsed JSON response of this JIRA REST resource using the following method:




The constructorData object is formed as follows:


var constructorData = {
    input: element,
    render: function(),
    getSuggestions: function(),
    maxSuggestions: number


The input property is a reference to the input field you wish to enable autocompletion on.


To initialize the module, you have to provide a render method.


function render(suggestions) {...}

This method will be called each time the user interacts with the input field. It will receive exactly one parameter - an array containing autocomplete suggestions. The array is formed as follows:


var suggestions = [
        text: 'string',
        onClick: function()

The text property contains the display text for a suggestion. The onClick property is a method that should be called when the suggestion is clicked.

It's up to you how to display the suggestions.


When called, this method should return this JIRA REST resource. The response should be a parsed JSON.


function getSuggestions (fieldName, callback) {...}

It receives exactly two parameters - the name of the field to get the suggestions for and a callback function. The callback function should be called as soon as the REST response arrives and should be given the parsed reponse as the only parameter.

This property is optional - if omitted, the plugin will not autocomplete values for fields.


The maximal number of suggestions you wish the module to generate.

This property is optional - if omitted, the plugin will generate every reasonable suggestion.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.