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

Scriptrunner what are the import utility classes

Scriptrunner what are the import utility classes we mention the top of scripting and from where i will get it?

2 answers

2 accepted

2 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 26, 2022

Under the covers, the code you write with Scriptrunner in groovy consist of Java code.

And in groovy just as in java, you can only interact with object classes that have been imported into the current context.

A class must already exist and be available within the class loader context before it can be explicitly imported into a script or another class. So that means that just about any class available in Jira will be available for import.

Generally, you will learn over time which classes are useful. But you can also consult the javadocs for your version:  E.g. to know what's available.

By default, classes that are provided by plugins won't be available. But Scriptrunner ships with a special "WithPlugin" class that let us get access to classes for a given plugin if you know the plugin key.

Also, it's possible to import classes not available in the Jira environment by using @grab statements. This will download the .jar files associated with the packages you grab from a public maven repository and store them locally.

Thanks @Peter-Dave Sheehan for sharing the info

0 votes
Answer accepted

Hi @Saqib Dar a small example, just explain base on concept of @Peter-Dave Sheehan , hope it help you
Example for @grab

@Grab(group='', module='groovyldap', version='0.1-SNAPSHOT')


def properties = Util.getProperties()

for (def key in properties.keySet()){"Key ---> " + key)



Example for Jira class:
import com.atlassian.jira.component.ComponentAccessor

def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_15923")

Thanks @Hieu for sharing the info

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events