In Bitbucket ScriptRunner you can create centralised scripts under Adminsitration > ScriptRunner > Script Editor
Those script can be used, e.g. in Administration > ScriptRunner > Merge Checks, when referencing them in the script editor within the web ui.
I face the issue that when an existing centralised script is updated, those updates don’t affect the Merge Check, where this script is used. The only two ways I figured out is to
- update the script within the Merge Check. Then the “whole thing” is reloaded and the updates inside the centralised script are recognised, or
- restart the server or bitbucket application.
Obviously there is some kind of caching, where the overall script is only updated, when the script within the Merge Check is updated.
My special case: I want to versionise the centralised scripts by setting up a git repository inside the file system directory, to update them all at once after implementations and/or refactoring is done. Of course I cannot fiddle around in all the places (Merge Checks, pre-hooks) when such an update occurs. It would also be bad, if I have to restart Bitbucket, just because I edited those files.
How can I enforce Scriptrunner to reload the central scripts and refresh all the effective scripts inside Merge Checks, Pre Hooks, etc. so that the changes inside the centralised script take effect?