Filter results gadget - Filter with Scriptrunner functions does not get results

Hi,

We have recently upgraded JIRA from v6.1.7 to v6.4.12. We were using Scriptrunner v2.1.16 and we updated it to v4.1.3.10 (we have a paid license).

After the upgrade the users started to complain that their dashboards which uses the Filter Results gadget is not working properly and the following message is shown:

"The filter configured for this gadget could not be retrieved. Please verify it is still valid on the issue navigator."

The filter used in the gadget uses Scriptrunner functions like subtaskOf(), isparentOf(), etc.

 

We've raised this issue in Atlassian support but their initial troubleshooting points that the issue relies in Scriptrunner. They verified that there's an exception when ScriptRunner querying the filter, e.g:

2016-05-18 01:41:15,866 http-bio-8443-exec-4641 ERROR pt100739 101x757303x5 1kzgh9s 10.46.254.25 /rest/gadget/1.0/issueTable/filter [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Cannot invoke method getI18nBean() on null object java.lang.NullPointerException: Cannot invoke method getI18nBean() on null object at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at com.atlassian.jira.plugin.JiraResourcedModuleDescriptor$getI18nBean.call(Unknown Source) at com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction.getI18n(AbstractScriptedJqlFunction.groovy:188)  <+2> (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:64) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:158) at com.onresolve.jira.groovy.jql.relations.RelationsOfMatchingQuery.setParameters(RelationsOfMatchingQuery.groovy:80)  <+2> (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:64) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) at com.onresolve.jira.groovy.jql.relations.RelationsOfMatchingQuery.getQuery(RelationsOfMatchingQuery.groovy:202) at com.onresolve.jira.groovy.jql.relations.RelationsOfMatchingQuery$getQuery.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at com.onresolve.jira.groovy.jql.relations.RelationsOfMatchingQuery$getQuery.call(Unknown Source) at com.onresolve.jira.groovy.jql.ScriptedJqlFunction.getQuery(ScriptedJqlFunction.groovy:109) at com.onresolve.jira.groovy.jql.ScriptedJqlFunction$getQuery.call(Unknown Source) at com.onresolve.jira.groovy.jql.ScriptedFunctionClauseFactory.getQuery(ScriptedFunctionClauseFactory.groovy:59) at com.atlassian.jira.jql.query.ContextAwareQueryVisitor.visit(ContextAwareQueryVisitor.java:116) at com.atlassian.jira.jql.query.ContextAwareQueryVisitor.visit(ContextAwareQueryVisitor.java:29) at com.atlassian.query.clause.TerminalClauseImpl.accept(TerminalClauseImpl.java:162) at com.atlassian.jira.jql.query.ContextAwareQueryVisitor.visit(ContextAwareQueryVisitor.java:64) at com.atlassian.jira.jql.query.ContextAwareQueryVisitor.visit(ContextAwareQueryVisitor.java:29) at com.atlassian.query.clause.AndClause.accept(AndClause.java:34) at com.atlassian.jira.jql.query.QueryVisitor.createQuery(QueryVisitor.java:55) at com.atlassian.jira.jql.query.DefaultLuceneQueryBuilder.createLuceneQuery(DefaultLuceneQueryBuilder.java:34) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.createLuceneQuery(LuceneSearchProvider.java:369) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getHits(LuceneSearchProvider.java:289) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:420) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:413) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:105)  <+2> (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497)  

 

Please let us know which more information you require.

BR,

Coriant.

1 answer

Hi Coriant,

There are a number of references to Lucene (indexing) in your exception.

Have you tried the offending filters in your issue navigator?

Have you re-indexed since upgrading? If not, could you please re-index and try the filter query in your issue navigator again?

Thanks in advance,
Mark. 

Hi Mark,

Yes, we tried the filter in the issue navigator. It takes a while to retrieve the data, but it does retrieve.

After the upgrade had finished we have made a full re-index. We didn't performed another re-index since then, as it supposedly does not requires it.

 

BR,

Coriant.

Coriant,

Can you please try disabling and re-enabling your ScriptRunner add-on and try again? If it still fails, could you please try re-indexing too?

Hi,

We had disabled/enabled the plugin and re-indexed JIRA without any improvements.

Just for testing we have applied the same JQL in our development server, that is still using the old versions of JIRA and Scriptrunner, and the time difference getting the results is abysmal. In the older version is way faster.

In the newer versions we can see several messages like the following in the atlassian-jira-slow-queries.log:

 

2016-05-19 09:44:45,173 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in parentsOf(type in subTaskIssueTypes() and status != closed)} AND {status != "closed"} AND {type in standardIssueTypes()}' produced lucene query '+issue_links:l:10000,d:o +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@4a0d6acf) +(+nonemptyfieldids:status -status:6 +visiblefieldids:status) +(type:10604 type:10400 type:192 type:11704 type:1 type:10701 type:223 type:10300 type:11100 type:428 type:28 type:10900 type:11600 type:10100 type:166 type:153 type:91 type:20 type:11 type:10700 type:99 type:10401 type:482 type:254 type:11300 type:4 type:11001 type:441 type:10908 type:496 type:495 type:11101 type:11701 type:2 type:16 type:11801 type:10901 type:142 type:13 type:11709 type:10800 type:10703 type:11000 type:277 type:11702 type:11706 type:10602 type:10801 type:26 type:15 type:11400 type:11301 type:239 type:41 type:10702 type:3 type:10600 type:11708 type:11707 type:425 type:310 type:11302 type:11200 type:6 type:7' and took '426' ms to run. 2016-05-19 09:44:50,819 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@4d6ca4fc) +(status:10996 status:1))' and took '944' ms to run. 2016-05-19 09:44:57,522 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@67329ab5) +(status:10996 status:1))' and took '647' ms to run. 2016-05-19 09:45:04,954 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@3556ffcf) +(status:10996 status:1))' and took '1027' ms to run. 2016-05-19 09:45:11,345 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@2521c31e) +(status:10996 status:1))' and took '624' ms to run. 2016-05-19 09:45:17,222 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@48b62350) +(status:10996 status:1))' and took '546' ms to run. 2016-05-19 09:45:23,750 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@1ea13025) +(status:10996 status:1))' and took '548' ms to run. 2016-05-19 09:45:29,503 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@32fb102e) +(status:10996 status:1))' and took '535' ms to run. 2016-05-19 09:45:35,158 http-bio-8443-exec-8850 INFO daalbano 584x1469284x29 nb3llx /rest/issueNav/1/issueTable [issue.search.providers.LuceneSearchProvider_SLOW] JQL query '{issuefunction in subtasksOf(issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes())} AND {status in ("active", "open")}' produced lucene query '+issue_links:l:10000,d:i +(+ConstantScore(com.atlassian.jira.issue.search.filters.IssueIdFilter@5c9e534f) +(status:10996 status:1))' and took '530' ms to run.

Here's an example of one the queries:

project = TNMSCM AND component in ("Optical Manager", "ASON Manager", "Protection Group Manager") AND (issuetype = "Fault Report" AND issueFunction not in hasSubtasks() AND status = Open OR issuefunction in parentsOf("issuefunction in subtasksOf (\"issuefunction in parentsOf ('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes()\") AND status in (active,open)")) ORDER BY Severity ASC

 

BR,

Coriant

Hi Coriant,

It might be a good idea to move this to our Product Support Portal and continue there. Since I don't have an email address, I can't raise this on your behalf.

Could you please create an issue here: https://productsupport.adaptavist.com/servicedesk/customer/portal/2

The first thing we'll ask for is if you could add us (cc) to the Atlassian SAC issue so we can understand what questions have already been asked.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 4 hours ago in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

74 views 0 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you