How to add custom listener groovy class for Script Runner plugin

Hello guys,

I know this question is quite childish, but we have been searching over net for getting this done but didn't get any appropriate solution and we are still stuck on adding Custom Listener as external file into Jira

Steps we did, created a Groovy class and pasted it in ../WEB-INF/classes/PACKAGEPATH

Also, we tried compiling this groovy class and pasted it on above location

Server was restarted after both the above steps, still have no effect

Can anyone please help us out in our first step

Thanks in advance for your support

1 answer

1 accepted

1 vote
Accepted answer
Henning Tietgens Community Champion Feb 05, 2014

You have to add a script listener and include the package path while providing the "Name of groovy class" (so it's "PACKAGEPATH.YourListener"). No restart needed.

Thanks Henning for the answer, adding a script listener and the package path is the second step, but before that we have to add the groovy file, right? We are stuck on deployment of the groovy file on proper location which will be loaded in JVM that could be used as Script Listener using the full class path.

What is the location for deployment of this groovy file or groovy's class file?

Henning Tietgens Community Champion Feb 05, 2014

It's like you wrote ../WEB-INF/classes/PACKAGEPATH.

So if your package is com.sakhale.groovy the file should be here


Henning, I have already tried this but it didn't seem to work.

Do we need to re-build the jar/war or something?

Henning Tietgens Community Champion Feb 06, 2014

No. Are you sure about the writing of your package and class names? It's case sensitive. After adding the script listener you should take a look into the log, to see if there are any error messages while the script runner tries to load the listener class.

Hi Henning,

After adding the groovy file on that location, I am getting ClassNotFoundException for GroovyObject, check below

Referer URL: http://localhost:2990/jira/secure/admin/groovy/CannedScriptListener.jspa?cannedScript=com.onresolve.jira.groovy.canned.workflow.listeners.CustomListener&atl_token=BMT7-7PUT-AYWX-I98G|1f48e45d5de7e253a474d71331955bdae3adca9f|lin

java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
Can you help me understand the reason behind this? and solution we can overcome this?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,948 views 19 22
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you