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

Search Jira Assets from Scriptrunner using variables

I am trying to use Scriptrunner to search my Assets for a particular object. However, the object will change so I would like to use a wild card/variable in my search. But I can't seem to figure out how to do that, if it is possible.

I can use in Scriptrunner and it works just fine if I am just typing in text much like I would do in a AQL/IQL search in Jira. But my objects I want to search for are currently in a groovy ArrayList and I want to step through each item and search for it. Just struggling on how to do it.

Was hoping for something kind of along the lines of this:

while (x <= myarraylist.size()) {"myObject = myarraylist[x]") something with it if it finds it kind of thing.......



Anyone have any thoughts?

1 answer

1 accepted

1 vote
Answer accepted

Finally got something working for myself. Ended up figuring out I can use smart values in my scriptrunner script. It does give a cannot call error on the add line, but it does it, so just went with it. Code below incase it helps someone else.

Currently using this script as part of a Jira Automation item, so I'm not specifying a ticket in the code since the automation will pass me a ticket.

def myField = issue.getCustomFieldValue(12626)
def x = 0

String[] elements = myField.split(",")
List<String> fixedLengthList = Arrays.asList(elements)
ArrayList<String> listOfString = new ArrayList<String>(fixedLengthList)

while (x <= listOfString.size()) {
    if ("CveID = ${listOfString[x]}")){
        issue.update {
            setCustomFieldValue('Tenable CVE Insight'){

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events