The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am creating several listeners within my instance which some would benefit from having a shared library of utility functions that I can use in different listeners to avoid code repetition (DRY).
I know that I could create a single script and do what's needed based on the event type, but it will be a big script and I want to keep it simple (KISS).
Is there a way of writing reusable code in the scriptrunner scripts? I know I can define shared constant values, but I am not sure about functions
I would start thinking about a custom plugin with a listener at this point. Scriptrunner is great at what it does but writing your own plugin will help you reuse code.
P.S : you will have to remove and add the listener every time you update the class.
Hello Danyal,
I'm relatively new to plugin development but I'd like to give this a try.
Would you be able to point me to an example custom plugin with a listener that's developed solely for the purpose of reusing existing code? We have several ScriptRunner REST endpoints that share a lot of code.
Many thanks!
Kamran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Searching further led me to this article by Alexey Matveev.
I have just skimmed through it but I feel confident that I should be able to take it from here.
Thanks anyways!
Kamran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.