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.