Help required in groovy script

Manikandan K April 25, 2018

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import org.apache.log4j.Category

def groupManager = ComponentAccessor.getGroupManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def group = groupManager.getGroup("ITOPS - Devops Team")

Getting below error while executing the above code. Let me know how to fix the issue.

 

 

java.lang.NoClassDefFoundError: groovy/lang/GroovyObject at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at org.codehaus.groovy.runtime.ProxyGeneratorAdapter$InnerLoader.defineClass(ProxyGeneratorAdapter.java:926) at org.codehaus.groovy.runtime.ProxyGeneratorAdapter.<init>(ProxyGeneratorAdapter.java:191) at groovy.util.ProxyGenerator.instantiateDelegateWithBaseClass(ProxyGenerator.java:225) at groovy.util.ProxyGenerator.instantiateDelegateWithBaseClass(ProxyGenerator.java:193) at groovy.util.ProxyGenerator.instantiateDelegate(ProxyGenerator.java:185) at groovy.util.ProxyGenerator.instantiateDelegate(ProxyGenerator.java:181) at org.codehaus.groovy.runtime.DefaultGroovyMethods.asType(DefaultGroovyMethods.java:15547)

2 answers

0 votes
Sana Safai
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.
April 25, 2018

Try it in the script console first, but please provide the Jira and ScriptRunner versions as well.

Manikandan K April 25, 2018

I m using scriptrunner version 5.2.1 and Jira 7.3.8.

Below is the screenshot when i run in console.  I m not at groovy. Please let me know what was the error

 

image.png

Sana Safai
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.
April 26, 2018
0 votes
Sana Safai
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.
April 25, 2018

Are you sure you're running nothing more than that code? When I enter an existing group in our Jira it works correctly. I don't think there's anything wrong with your code.

Manikandan K April 25, 2018

image.png

Suggest an answer

Log in or Sign up to answer