ScriptRunner autocomplete for custom classes

Hi,

I’m working on some custom classes (GitHub - CollabInfra/scriptrunner-common: Collection of classes and scripts for ScriptRunner for Jira (Server and Data Center).), and I’m trying to get autocomplete to work, in a script like this:

import com.atlassian.jira.component.ComponentAccessor
import common.confluence.SpaceUtils

def adminUser = ComponentAccessor.userManager.getUserByName("admin")
def spaceUtils = new SpaceUtils()

Problem is: as soon as I import a class from my custom package, auto completion stops working for every classes, and I’m getting ton of errors in the log:

2022-09-05 15:19:46,382-0400 http-nio-2990-exec-10 ERROR admin 919x19646x1 8jws5h 0:0:0:0:0:0:0:1 /rest/scriptrunner/latest/codeinsight/completions [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: BUG! exception in phase 'conversion' in source unit 'Script154.groovy' exception in phase 'conversion' in source unit '/Users/probert/Documents/JiraTests/target/jira/home/scripts/common/confluence/SpaceUtils.groovy' The lookup for common.confluence.AppLink caused a failed compilation. There should not have been any compilation from this call.
BUG! exception in phase 'conversion' in source unit 'Script154.groovy' exception in phase 'conversion' in source unit '/Users/probert/Documents/JiraTests/target/jira/home/scripts/common/confluence/SpaceUtils.groovy' The lookup for common.confluence.AppLink caused a failed compilation. There should not have been any compilation from this call.
	at org.codehaus.groovy.control.ClassNodeResolver.findByClassLoading(ClassNodeResolver.java:214)
	at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:198)
	at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
	at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
	at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:853)
	at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:467)
	at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1422)
	at com.onresolve.scriptrunner.stc.completions.StubbedResolveVisitor.super$5$visitClass(StubbedResolveVisitor.groovy)
	at jdk.internal.reflect.GeneratedMethodAccessor1645.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
	at com.onresolve.scriptrunner.stc.completions.StubbedResolveVisitor.visitClass(StubbedResolveVisitor.groovy:32)
	at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:230)
	at org.codehaus.groovy.control.ResolveVisitor$startResolving.call(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.ResolveVisitorCustomiser$_call_closure1.doCall(ResolveVisitorCustomiser.groovy:42)
	at jdk.internal.reflect.GeneratedMethodAccessor1644.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:405)
	at groovy.lang.Closure.call(Closure.java:421)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2330)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2315)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2356)
	at org.codehaus.groovy.runtime.dgm$186.invoke(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at com.onresolve.scriptrunner.stc.completions.ResolveVisitorCustomiser.call(ResolveVisitorCustomiser.groovy:42)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1084)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:640)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:618)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:595)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401)
	at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
	at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341)
	at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338)
	at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:320)
	at groovy.lang.GroovyClassLoader.recompile(GroovyClassLoader.java:858)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:814)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:883)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:576)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:773)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:648)
	at org.codehaus.groovy.control.ClassNodeResolver.findByClassLoading(ClassNodeResolver.java:209)
	at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:198)
	at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
	at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
	at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:853)
	at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:467)
	at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1422)
	at com.onresolve.scriptrunner.stc.completions.StubbedResolveVisitor.super$5$visitClass(StubbedResolveVisitor.groovy)
	at jdk.internal.reflect.GeneratedMethodAccessor1645.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
	at com.onresolve.scriptrunner.stc.completions.StubbedResolveVisitor.visitClass(StubbedResolveVisitor.groovy:32)
	at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:230)
	at org.codehaus.groovy.control.ResolveVisitor$startResolving.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.control.ResolveVisitor$startResolving.call(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.ResolveVisitorCustomiser$_call_closure1.doCall(ResolveVisitorCustomiser.groovy:42)
	at jdk.internal.reflect.GeneratedMethodAccessor1644.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:405)
	at groovy.lang.Closure.call(Closure.java:421)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2330)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2315)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2356)
	at org.codehaus.groovy.runtime.dgm$186.invoke(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at com.onresolve.scriptrunner.stc.completions.ResolveVisitorCustomiser.call(ResolveVisitorCustomiser.groovy:42)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1084)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:640)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:618)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:595)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401)
	at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
	at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341)
	at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338)
	at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:320)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:262)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:331)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.compile(GroovyScriptEngineImpl.java:181)
	at javax.script.Compilable$compile.call(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService$_configureRequestContext_closure8.doCall(CompletionRequestService.groovy:196)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService$_configureRequestContext_closure8.doCall(CompletionRequestService.groovy)
	at jdk.internal.reflect.GeneratedMethodAccessor1603.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:37)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
	at com.onresolve.scriptrunner.runner.classloading.ClassLoaderUtils.withUnsetContextClassLoader(ClassLoaderUtils.groovy:11)
	at com.onresolve.scriptrunner.runner.classloading.ClassLoaderUtils$withUnsetContextClassLoader.call(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService.configureRequestContext(CompletionRequestService.groovy:193)
	at jdk.internal.reflect.GeneratedMethodAccessor1601.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:184)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService.getRequestContext(CompletionRequestService.groovy:169)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService$getRequestContext$0.callCurrent(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService.getRequestContext(CompletionRequestService.groovy:153)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService$getRequestContext.callCurrent(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService.getResponse(CompletionRequestService.groovy:63)
	at jdk.internal.reflect.GeneratedMethodAccessor1598.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:351)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:64)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:184)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService$_getCompletions_closure2.doCall(CompletionRequestService.groovy:82)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService$_getCompletions_closure2.doCall(CompletionRequestService.groovy)
	at jdk.internal.reflect.GeneratedMethodAccessor1615.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:405)
	at groovy.lang.Closure.call(Closure.java:399)
	at com.adaptavist.scriptrunner.jfr.events.EventWrapper.call(EventWrapper.java:44)
	at com.adaptavist.scriptrunner.jfr.events.EventWrapper$call$2.call(Unknown Source)
	at com.onresolve.scriptrunner.stc.completions.CompletionRequestService.getCompletions(CompletionRequestService.groovy:79)
	at jdk.internal.reflect.GeneratedMethodAccessor1613.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
	at groovy.lang.MetaClassImpl.invokeMethodClosure(MetaClassImpl.java:1050)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1092)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:405)
	at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:50)
	at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:122)
	at com.sun.proxy.$Proxy5221.responseFor(Unknown Source)
	at com.onresolve.scriptrunner.runner.rest.common.CompletionsEndpoint$CodeInsightResponseProvider$responseFor.call(Unknown Source)
	at com.onresolve.scriptrunner.runner.rest.common.CompletionsEndpoint.codeInsightResponse(CompletionsEndpoint.groovy:185)
	at com.onresolve.scriptrunner.runner.rest.common.CompletionsEndpoint$codeInsightResponse.callCurrent(Unknown Source)
	at com.onresolve.scriptrunner.runner.rest.common.CompletionsEndpoint.getCompletions(CompletionsEndpoint.groovy:77)
	at jdk.internal.reflect.GeneratedMethodAccessor1611.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	... 19 filtered
	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:160)
	... 1 filtered
	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:70)
	... 32 filtered
	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
	... 8 filtered
	at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:59)
	... 4 filtered
	at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
	... 3 filtered
	at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55)
	... 8 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 24 filtered
	at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
	... 22 filtered
	at com.atlassian.ratelimiting.internal.filter.RateLimitFilter.doFilter(RateLimitFilter.java:73)
	... 3 filtered
	at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
	... 17 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
	... 16 filtered
	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:38)
	... 3 filtered
	at com.atlassian.pats.web.filter.TokenBasedAuthenticationFilter.doFilter(TokenBasedAuthenticationFilter.java:83)
	... 3 filtered
	at javax.servlet.FilterChain$doFilter.call(Unknown Source)
	at com.adaptavist.scriptrunner.jfr.servlet.FlightRecordingFilter.doFilter(FlightRecordingFilter.groovy:32)
	... 19 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 5 filtered
	at com.atlassian.plugins.authentication.impl.basicauth.filter.DisableBasicAuthFilter.doFilter(DisableBasicAuthFilter.java:70)
	... 3 filtered
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:215)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:206)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:134)
	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:123)
	... 4 filtered
	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
	... 8 filtered
	at com.atlassian.ratelimiting.internal.filter.RateLimitPreAuthFilter.doFilter(RateLimitPreAuthFilter.java:71)
	... 3 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
	... 3 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 26 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 24 filtered
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during instruction selection: Cannot cast object 'org.codehaus.groovy.ast.expr.TupleExpression@d9f41[]' with class 'org.codehaus.groovy.ast.expr.TupleExpression' to class 'org.codehaus.groovy.ast.expr.ArgumentListExpression'

Does anyone knows the root cause for this?

1 Like

Hi Pascal,

I don’t know, it should work… I just tried something similar:

image

Please could I ask you to open a support ticket at Service Management

We need to get your version info, and some minimal code to be able to replicate the problem. Maybe the isssue is in SpaceUtils for instance.

Please write on the ticket that it is for escalation to a developer, and reference back to this post!

cheers, jamie

BTW if you’d like to have a conference call with a couple of the devs here to discuss your project, feel free to say so on the support ticket. We are working on something that may not be entirely dissimilar.

I tried with a clone of your repo and it seems to work for me… (are you using a script plugin?)

Anyway, get in touch via support and we’ll try to work it out.

I am not using a script plugin, I’m working directly in an instance from the SDK (sadly, I don’t have access to Jira and Confluence instances anymore). I’m running Jira 8.20.7 from the SDK.

Maybe it’s because of the .git folder? To avoid copying code around, I have the repo directly in the scripts directory, and when I’m “satisfied” with the code, I directly commit/push from the scripts folder. I will try to move the .git folder to see if it fixes the issue, but since it’s a REST call that return the error, I don’t think it’s the issue.

What version of ScriptRunner?

6.58.0

FYI: removing the .git directory didn’t fix the issue.

So support created https://productsupport.adaptavist.com/browse/SRJIRA-6130 - looks like it just affects class suggestions. We will take a look.

This should be fixed in the 7.0.0 version released to marketplace, a day or two ago.
cheers, jamie

1 Like

I confirm that it works fine with 7.0.0