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:
and pass the parsed JSON response of this JIRA REST resource using the following method:
The constructorData object is formed as follows:
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.
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:
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.
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.