Hello,
Please see the below code snippet which is throwing the error-
Code snippet-
def pillarCF = customFieldManager.getCustomFieldObject(10273);
def selectConfig = pillarCF.getRelevantConfig(getContext())
def selectOptions = ComponentAccessor.optionsManager.getOptions(selectConfig)
error-
2021-04-16 15:35:35,109 ERROR [common.UserScriptEndpoint]: ************************************************************************************* 2021-04-16 15:35:35,111 ERROR [common.UserScriptEndpoint]: Script console script failed: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getContext() is applicable for argument types: () values: [] Possible solutions: getContext(), setContext(javax.script.ScriptContext) at Script215.run(Script215.groovy:41)
Any help would be appreciated..
Hi @Priyanka khare ,
getContext() is not an available function in your Script.
I think you are using Scriptrunner behaviour , can you try the following change?
def issueObject = issueManager.getIssueObject(getContextIssueId())
def pillarCF = customFieldManager.getCustomFieldObject(10273);
def selectConfig = pillarCF.getRelevantConfig(issueObject)
def selectOptions = ComponentAccessor.optionsManager.getOptions(selectConfig)
I adapted your code with the below answer, hope that helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.