How to force recompilation of scripts

Karsten Neumann April 13, 2018

I have a setup with several classes defined in groovy scripts. These classes have dependencies, so the change of a class script file will affect other scripts.

As far as I understand if I run a script via the script console or as a script REST endpoint, we just recompile if the script I actually run has been changed.

If I just change a dependency, the change will not have an effect.

Is there a way to force a new compilation of all classes/scripts used without

* restarting the JIRA server or

* manually change the source that is actually run

? Thanks!

Karsten

3 answers

1 vote
Karsten Neumann April 15, 2018

...currently the best way is the Scriptrunner built in script "Clear classloader or jira internal caches"; If I clear the "Groovy class loader" cache, all scripts are recompiled when they are used the next time. This just slows down the next script executions, but works fine for me.

0 votes
Ron Elazar September 8, 2019

is there something like this for confluence ?

Karsten Neumann September 8, 2019

There is definitely a need for the same mechanism in Confluence, however we have not yet been able to force a recompilation of Scripts in Confluence. Even worse, there is no "built in script" in Scriptrunner for Confluence to clear the class cache. Current workaround is to deactivate an reactivate the Scriptrunner plugin in Confluence - does the job, but this should never be routine in a production instance...

0 votes
Alexey Matveev
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 13, 2018

What is your scriptrunner version?

Karsten Neumann April 13, 2018

my version is 5.1.6

Alexey Matveev
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 13, 2018

I see. they fixed it actually in 5.2.x

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events