Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Defining a class to be used in groovy scripts

Siavosh Kasravi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2020

Is there a way to define a groovy class somewhere and import it when needed in a groovy script in ScriptRunner for example?

1 answer

1 accepted

0 votes
Answer accepted
Raziman Dom - Ricksoft
Community Champion
October 12, 2020

Yup, you can do that.

Create a new class using ScriptRunner Script Editor

Screenshot 2020-10-13 at 12.48.17 AM.png

Then you can call it on Script Console:

Screenshot 2020-10-13 at 12.46.14 AM.png

If you created the script in a new folder, please make sure to follow this guide to import the class.

Suggest an answer

Log in or Sign up to answer