How to execute JQL in JIRA8.5.7. We have two methods available which can be used.
- SearchIssues
- Search provider.
How to execute JQL in JIRA8.5.7. We have two methods available which can be used.
Thanks for the reply. I have started using Search Service but facing issue like below.
2020-10-12 23:49:34,289 DEBUG [jira.groovy]: ErrorIncorrect usage of JIRA/lucene search API. You can only create/use: ManagedIndexSearcher inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtils for details.
2020-10-12 23:49:34,289 DEBUG [jira.groovy]: ErrorIncorrect usage of JIRA/lucene search API. You can only create/use: ManagedIndexSearcher inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtils for details.
My code for executing a JQL is below
public List getReleaseInfo(String queryStr)
{
def query = jqlQueryParser.parseQuery(queryStr)
List issues = null
try{
ThreadLocalSearcherCache.startSearcherContext();
log.debug "queryStr"+queryStr
SearchResults results = searchService.search(user,query, PagerFilter.getUnlimitedFilter())
issues = results.getResults()
return issues
}
catch (Exception e)
{
e.printStackTrace();
String error = e.getMessage()
log.debug "Error" + error
return issues
}
finally {
ThreadLocalSearcherCache.stopAndCloseSearcherContext()
}
}
Please help me to fix it.