In Jira, how can I iterate thru the results of a JQL in Automation? - lookupissues doesn't work

Cash Coyne
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 17, 2023

In Jira Automation, I want to iterate through the results of a JQL query, then perform som actions on each item before going onto the next one.

 

I tried a POC using the Audit Log as my action and lookupIssues  in a branch to use for looping (as I understand it).  But it only acts on the first issue that is retrieved (there should be 11 issues in my test).

What am I doing wrong?  This is my rule:

image.png

 

 

1 answer

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 17, 2023

Hi @Cash Coyne 

is there any output in rhe audit log? Could you share the audit log here too?

Furthermore:
Could you add a log action before the branch just logging the lookupIssues to see if the lookup action returns the expected result.

Best
Stefan

Cash Coyne
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 17, 2023

Hi @Stefan Salzl , that helped, but not in the way you'd think.  I investigated why I would get only one issue.  Turns out, Jira Automation doesn't like filters that have actual names for assignees, not their ID.  I have filters like:

assignee = ("Tom Jones","Mick Jagger","Taylor Swift")

And I had a Filter = "FilterName" in my JQL and that was only returning one issue.  When I changed the names to the IDs, it worked.  I also tested it by using email addresses instead of IDs and that worked to.  It's just User Names it has a problem with.  I prefer names to IDs as it's a heck of a lot easier to edit and update my filters!

So add that tidbit to your automation troubleshooting tips

Like Stefan Salzl likes this
Bill Sheboy
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 17, 2023

Hi @Cash Coyne 

The work-around for that account ID behavior of JQL is to use the IN operator and quotation marks.  For example:

assignee IN ("user name 1", "user name 2", "user name 3")

That will leave the names as-is, without switching them to account ID values, for the search.

Kind regards,
Bill

Like Stefan Salzl likes this
Cash Coyne
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 17, 2023

That's the way I had tried it to begin with and it didn't work in automation, but it does in a Search using JQL., Just ID's or emails work in Automation. 

Bill Sheboy
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 18, 2023

Hi @Cash Coyne 

That is curious...

I just tested JQL in that format with a Scheduled Trigger, Branch on JQL, and Lookup Issues and all of them worked.

Would you please show what you tried?

Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events