Fast way to test Groovy custom listeners?

I'm currently working on a groovy custom listener using the script runner plugin. Because my listener is a class, the only way I've gotten JIRA to recognize changes is to restart it. This is really slowing me down... Is there a fast way to get JIRA to see changes in the class?

2 answers

1 accepted

0 votes
Accepted answer

Normaly it should be sufficient to replace the script. If this doesn't work use the built in script "Clear classloader or jira internal caches" from the script runner plugin to reset the groovy classloader cache.


Thanks Henning. Unfortunately, I tried clearing both the classloader AND the jira cache, but I still had to restart JIRA to get it to see my changes.

This is weird. I have classes which are used by listeners or scripts which are not refreshed if I copy a new file to the server, but they are always refreshed if I clear the groovy classloader cache. Maybe you should provide more details about your installation (script runner plugin version, JIRA version and environment) and hopefully @Jamie Echlin could help?

Henning - Thanks for sticking with me on this one! I've never had this problem testing scripted post functions, as those always reflect the latest version of the script. However, given my lack of experience with Groovy/Java, it's entirely possible I'm doing something very silly and just can't see it.

I'm testing my code using the SDK (version 4.2.9) on a windows 7 32-bit PC. I start JIRA with "atlas-run-standalone --product JIRA --version 6.0.1". I am using scriptrunner version 2.1.15. I figured that once I had it working, I'd move to my staging server and verify performance before going to the live server.

The listener itself doesn't really do anything at this point - all I'm doing right now is logging various custom fields.

I finished the listener, so I no longer need the answer (until it happens again). But Henning's original response was new info for me, so I'm marking his answer as correct.

Hello. I'm facing exactly this problem. Found others with the same problems, but no effective sollution. I'm running Jira 6.1.3 and Script Runner  2.1.16. Thanks in advance.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Jira

Make your Atlassian Cloud products more secure: our NEW admin security guide

Hey admins! I’m Dave, Principal Product Manager here at Atlassian working on our cloud platform and security products. Cloud security is a moving target. As you adopt more products, employees consta...

139 views 0 6
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