Fast way to test Groovy custom listeners?

Jason Plumhoff
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.
October 7, 2013
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
Answer accepted
Henning Tietgens
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.
October 7, 2013

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.

Henning

Jason Plumhoff
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.
October 8, 2013
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.
Henning Tietgens
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.
October 8, 2013

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?

Jason Plumhoff
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.
October 8, 2013

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.

0 votes
Jason Plumhoff
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.
October 16, 2013

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.

Rafael M. July 27, 2017

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