Is there a way to have JQL functions auto-complete parameters?
Take the hypothetical example of a custom JQL function such as {{reporter in timeZone("")}} to list all issues reported in a particular timezone. Instead of having a user figure out and manually enter the hieroglyphics to specify a Java timezone, can JIRA offer up the list of timezones as simple auto complete options?
Community moderators have prevented the ability to post new answers.
Hi Amit
Could you find out how to enable autocomplete for custom JQL functions?
Javascript side of auto complete function does not send any query to serverside so implementing only ClauseValuesGenerator will not help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA does this for select lists, so I assume that the SelectSearcher has something about it. Comparing it to TextSearcher I see that JqlSelectOptionsUtil is used and looks like a possible example.
~Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ack, I completely missed your response to this.
I'll take a look at the suggested SelectSearcher, TextSearcher, and JqlSelectOptionsUtil classes and share any interesting findings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like the JQLAutoComplete.js code calls the REST resource /rest/api/1.0/jql/autocomplete which is a defined in
./jira-project/jira-components/jira-plugins/jira-rest-plugin/src/main/java/com/atlassian/jira/rest/v1/jql/AutoCompleteResource.java
The method getAutoCompleteResultsForField then calls a specific ClauseHandler, which was defined in the Searcher for the field. For versions the class is VersionClauseValuesGenerator
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The classes that generate the values all implement this interface
http://docs.atlassian.com/jira/4.4/com/atlassian/jira/jql/values/ClauseValuesGenerator.html
If you're considering doing your own autocompletion, you have to change the searcher for your custom field to use such a class. The only context when making the choice about what to return are the following parameters
* @param searcher the user preforming the search.
* @param jqlClauseName the jql clause name that was entered by the user, represents the identifier that was used
* to find this values generator. Note: for custom fields this can be used to identify the custom field we are
* dealing with.
* @param valuePrefix the portion of the value that has already been provided by the user.
* @param maxNumResults the maximun number of results to return.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.