Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Looking for a better workflow when updating custom classes in the script editor


I have created a custom class in the script editor. Let's assume it is "MyClass" in the package "my.package". When I go to the console, I can import that class with "import my.package.MyClass", instantiate it and run a method on it. So far so good.

What worries me is that when I chance the code in my class, it is not immediately visible to the console as the class is being cached. I learned that I need to clear the Groovy classloader, but when I do that my class actually completely vanishes. If I run the same code in the console (which worked before), it now says, that it cannot find the class.

I explicitly need to run the Groovy class file in the console to get it loaded again. After that the code will start working again.

I am not not sure what I am doing wrong. I do not have an issue with running the Groovy classloader, but the class should then be found again.

Can you help?


1 answer

1 accepted

0 votes
Answer accepted

In my experience, you can cause the updated class to be re-compiled by changing the console script.

Even adding a space on a blank line suffices.

If your script points to MyClassA, and MyClassA has a dependency to MyClassB. This will only work if MyClassA change. It won't if only MyClassB changes. In this case, you want to make a change to MyClassA as well as the Console. The console change will cause MyClassA to be checked for changes. The change will cause MyClassB to be checked.

Stupid me. The groovy file names in the Script Editor need to carry the exact name of the class they are carrying, so my class needed to be on the file "my/package/MyClass.groovy". Sorry for the fuzz.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events