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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.