scriptrunner ambiguous method error

I am using ScriptRunner to Fast Track an issue that comes in from Service Desk.  FOr the most part, this is working great.  However for a small number of users it does not do the fast track and throws this error:

Exception in thread "Thread-3084" groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method com.atlassian.jira.security.JiraAuthenticationContextImpl#setLoggedInUser.

Cannot resolve which method to invoke for [null] due to overlapping prototypes between:

	[interface com.atlassian.crowd.embedded.api.User]

	[interface com.atlassian.jira.user.ApplicationUser]

	at groovy.lang.MetaClassImpl.chooseMostSpecificParams(MetaClassImpl.java:3202)

	at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3154)

	at groovy.lang.MetaClassImpl.chooseMethod(MetaClassImpl.java:3097)

	at groovy.lang.MetaClassImpl.getMethodWithCachingInternal(MetaClassImpl.java:1325)

	at groovy.lang.MetaClassImpl.createPojoCallSite(MetaClassImpl.java:3323)

	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:129)

	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)

	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)

	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)

	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)

	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.doTransition(FasttrackTransition.groovy:135)

	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.this$2$doTransition(FasttrackTransition.groovy)

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.lang.reflect.Method.invoke(Unknown Source)

	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)

	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)

	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)

	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.this$dist$invoke$1(FasttrackTransition.groovy)

	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition$1.methodMissing(FasttrackTransition.groovy)

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.lang.reflect.Method.invoke(Unknown Source)

	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

	at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:933)

	at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256)

	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209)

	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)

	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)

	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)

	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)

	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition$1.run(FasttrackTransition.groovy:97)

	at java.lang.Thread.run(Unknown Source)

 

Not sure why it is working for some and not others.  

Has anyone seen this before?  

2 answers

0 votes

It looks like it will fail if the transition is done by anonymous, ie no user is logged in. Seems to be a bug. Does that seem to be the case, if you look at the transition history of the affected records?

That is where I am confused by this, the transition this is a post-function for is "Create" and the permissions require that for create a user be member of jira-users... so they would have to be logged in.   The Fast Track takes them to another status, Need More Info for which there are no conditions or validators.  

From the code it looks like it would fail, so I created a ticket: https://jamieechlin.atlassian.net/browse/GRV-536 If that's not your issue can you find some pattern for the ones that failed...?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

314 views 0 1
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