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

This widget could not be displayed.
Henning Tietgens Community Champion Oct 07, 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

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 Community Champion Oct 08, 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?

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.

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

223 views 3 0
Join discussion

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