versionMatch is broken in JIRA 6.4.11 and scriptrunner 3.1.4

Hi Jamie,

I keep getting errors when use the versionMatch JQL function

issuefunction in versionMatch(regexp)

even on a vanilla JIRA with just scriptrunner 3.1.4. It always gives me an error

Error occurred communicating with the server. Please reload the page and try again.

no matter which regexp i try. The stack trace looks like

2015-09-03 09:55:57,249 http-bio-38443-exec-2 ERROR xxxxx595x71x2 o566vg xxx.xxx.xxx.xxx /rest/issueNav/1/issueTable [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: java.lang.NullPointerException: Null keys are not supported
com.atlassian.cache.CacheException: java.lang.NullPointerException: Null keys are not supported
        at com.atlassian.cache.memory.DelegatingCache.rejectNullKey(DelegatingCache.java:291)
        at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:312)
        at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.getCustomFieldObjectsByName(DefaultCustomFieldManager.java:381)
        at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.getCustomFieldObjectByName(DefaultCustomFieldManager.java:360)
        at com.atlassian.jira.issue.CustomFieldManager$getCustomFieldObjectByName$2.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
        at com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction.getField(AbstractScriptedJqlFunction.groovy:125)
        at com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction$getField.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
        at com.onresolve.jira.groovy.jql.entitymatch.MatcherCollector.<init>(MatcherCollector.groovy:38)  <+3> (NativeConstructorAccessorImpl.java:62) (DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:232)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:252)
        at com.onresolve.jira.groovy.jql.entitymatch.AbstractEntityMatch.getQuery(AbstractEntityMatch.groovy:86)
        at com.onresolve.jira.groovy.jql.entitymatch.AbstractEntityMatch$getQuery.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:138)
        at com.onresolve.jira.groovy.jql.ScriptedJqlFunction.getQuery(ScriptedJqlFunction.groovy:99)
        at com.onresolve.jira.groovy.jql.ScriptedJqlFunction$getQuery.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:138)
        at com.onresolve.jira.groovy.jql.ScriptedFunctionClauseFactory.getQuery(ScriptedFunctionClauseFactory.groovy:57) 
        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

any ideas?

Fortunately i could find a workaround using

issueFunction in issueFieldMatch()

 

Regards,

Dieter

1 answer

Dieter,

I tried this myself and the correct syntax for using versionMatch is:

fixVersion in versionMatch("^RC.*")

You can find the same versionMatch syntax in the documentation here:

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_projectmatch_componentmatch_versionmatch

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,314 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot