scriptrunner ambiguous method error

Rodney Sawyer October 15, 2014

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
Rodney Sawyer October 15, 2014

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.  

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2014

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...?

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2014

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events