Enjoying the JQLT functions? Or did you run in to any issues? Before raising a Support Ticket or writing to our support, please check if you have run into one of the known issues.
Searches not Returning results due to ClauseTooComplexSearchException
This usually happens with large JIRA instances having hundreds of thousands of issues. JQL Tricks creates Apache lucene indexes for complex searches and it is likely that you have run into a known JIRA issue documented at https://jira.atlassian.com/browse/JRA-19350.
If you perform a valid search and the plugin is not returning any results, check the atlassian-jira.log file to see if you have run into the following error:
2016-11-29 02:16:42,245 http-nio-80-exec-116 ERROR ra185165 136x31430237x9 6e0p70 153.53.2.125,192.127.253.68 /rest/issueNav/1/issueTable [c.a.j.p.i.service.issuetable.DefaultIssueTableService]com.atlassian.jira.issue.search.ClauseTooComplexSearchException: A the following query was too complex to generate a query from: {issue in functionName()}
As you can see in the comment posted by Jozsef, you are hitting as limit set by Apache Lucene. This limit is not extendible by the JQL Tricks plugin, as it is handled in the JIRA core code.
Having said that, there is an easy workaround. JIRA has an advanced property, named jira.search.maxclauses, which determines the maximum number of clauses possible in a JQL query. And its default value is 65000. If you have a query that potentially returns more than 65K results, you can override the property to have a bigger value, depending on the size of the resultset you have.
Create jira-config.properties file under <jira-home> directory, if it doesn't already exist.
Add the jira.search.maxclauses property with the new value:
jira.search.maxclauses = 100000
Replace 100000 with a reasonable value for your environment. We would recommending starting with a value higher than the total number of issues in your JIRA instance and try smaller values, after you get it working, to set the lowest feasible value as the limit. We haven't see any impacts due to increasing this value but it makes sense to use a smaller limit as long as the functions are working as expected.
Please keep in mind that the value will differ based on the data you have and the functions you are using. There is no one limit that works for all customers and their environments!
Restart JIRA
After the above steps, the function will start working again.
PS: Don't forget to watch JRA-19350 for any future updates on that ticket from Atlassian.
In order to verify the issue, please generate a HAR file and check if the network tab is returning no response code for the search queries. In that case, you are hitting the default AJAX timeout period that prevents requests in the browser from running for unlimited amounts of time. Normally 30 seconds is plenty of time for a typical data request but that may not be the case for some of the complex JQLT functions.
For example, a function like movedIssues scans the change history of issues and typically takes more than 30 seconds on large JIRA instances with hundreds of thousands of issues. While adding more hardware (CPU and memory) can help, that will not be enough. That is where we will have to increase the default Ajax Timeout as mentioned in the JIRA KB article.
In order to quickly test this, please follow the KB article to add a higher Ajax timeout value in the JIRA Announcement banner. For example, you can increase the timeout to 10 minutes by adding the following snippet in the Announcement banner.
<script>
AJS.$.ajaxSetup({
timeout: 600000 // Milliseconds, 10 minutes in this example.
});
</script>
The value might change for different customers and different environments, depending on the data you have on the system.
INTERMITTENTLY SHOWING WRONG RESULTS
Are you seeing wrong search results intermittently? If so, check your JQLT cache delay settings. You might be seeing a cached result from an earlier run.
Please note that it is possible to set a global cache delay at JQLT Configuration and also override it at a function level under JQLT Function Configuration. Make sure you check the cache delay at both places to ensure you have an appropriate value configured at both places.
Set the value as "0" if you want to disable caching.
Missing results from certain projects
Are you noticing that your search results are missing results from certain projects? If so, there are two possibilities.
You have limited your JQLT function to be available only on selected projects.
This is a great feature if you want to limit certain functions to be used only in selected projects but it is possible that you might have missed to amend the list when a new project was added. Or that project was unintentionally selected while configuring other functions. By default, JQLT plugin will display a warning when a function is limited to certain projects but it is possible to hide the warnings in the configuration.
Either you can amend the configuration to remove all selected projects, to force the default behavior of running in all projects, or add the missing projects to the existing selection. It is recommended not to selected hundreds of projects to avoid complex query execution in the backend. If there is no reason to limit the functions to selected projects, the recommendation is to leave all projects unselected.
jqltField custom field is configured only for selected projects
Behind the scenes, JQL Tricks plugin uses a custom field, named jqltField, to index the data. If you configure this custom field to selected projects, search results will be missing from the other projects.
It is recommended not to modify the configuration of this custom field.