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.
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 Assets.search() 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()) {
Assets.search("myObject = myarraylist[x]")
.....do something with it if it finds it kind of thing.......
x++}
Anyone have any thoughts?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.