You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I have written a script in a listener which gets some properties from an issues and adds them up. The sum is stored in another field. The listener currently works on the events "Issue Created" and "Issue Updated".
The logic in the script might change at some point and I would like to then run the script on all issues within a project.
Where do I place my code so that I can use it in a listener as well as e.g. in the console or in a scheduled job? I placed a groovy file into the script editor and the file now contains a groovy class "MyClass" in a package like "my.package".
Is there any change I can access this class in a listener using in import such as "import my.package.MyClass", create an instance and run a method passing in the issue from the listener event?
Thanks,
Tobias.
Mmh. I might have made some mistake, but it seems to work now. I was able to import my class on the "Console", instantiate it and run a method on it. Sorry for the noise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.