I believe it would be a useful feature to be able to share segments of code between scripts.
This would save on code redundancy and usage of the limited script storage space.
I guess it would essentially be working as a module system but only internally to script runner. Where the modules or even just specific methods could be imported/called inside Script Listeners, Scheduled Jobs and even the Script Console.
My use case would be storing a helper method I wrote, for handling all REST requests and processing the response. I copy and paste this into all my scripts for convenience at the moment.
I think this is the same as #38?
This does seem to be the same as #38 . This feature would be very useful for our company too since we also reuse the same methods in many scripts. A concept similar to Script Variables where I can define functions to reuse would be great.
Update: In-app access to library scripts is now available in ScriptRunner for Jira Cloud.
The new “Example Scripts” button is your go-to destination for quickly finding both basic and advanced example scripts, all without leaving the ScriptRunner app.
The examples are pre-filtered to match the feature screen you’re working on, so, for instance, you’ll only see Listener scripts when you’re on the Script Listeners screen.