Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a "For Each" loop on automations on Jira Server?

mateus.oliveira December 7, 2023

I'm trying to create a verification that, for each category added in a specific field, would map all of the issues in that same day that also contains that category, and check if that amounts beyond a certain limit.

Since this is a List custom field (multiple values), I was trying to create a variable to hold the category name and do the lookup, but I need to check each of the categories separately... When I tried gathering the information, it read the multiple values as a string instead of an array. I couldn't find out how to do a "For-Each" iteration... it seems this is a native feature in Jira Cloud... Does Jira server have a similar feature?

Thanks!

1 answer

1 vote
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.
December 7, 2023

Hi @mateus.oliveira 

The different versions of Jira have different versions of automation rule features...Does your version have the Advanced Branch type for rules, as described below?  If so, that could be used.

https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935

Kind regards,
Bill

mateus.oliveira December 7, 2023

Hi Bill, thanks for replying!

It seems this new type of branching is only available on Jira Cloud... we use Jira Server over here, my automation screen is totally different from the one in the link you provided.

So far, I believe Jira Server has no way to emulate a "For-Each" looping...

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.
December 7, 2023

In that case, I believe Jira Server automation can only loop over issues.  Here is the suggestion to add advanced branching to both Server and Data Center versions in case you want to vote for / watch it for progress.

https://jira.atlassian.com/browse/JIRAAUTOSERVER-749

 

I suppose an elaborate work-around would be to create an external service in another programming language (and called from your rule with Send Web Request) which could iterate over the values, and generate a webhook that could be listened for in a different rule.  That would trigger once for each value.

Moheeb Qupty May 23, 2024

Hi Bill,

 

How can I vote and watch this feature?

I have logged in on the issue but haven’t found a way to click for voting?

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.
May 24, 2024

Once you are logged in, there should be hyperlinks to vote for or watch the issue at the top-right of the page.

Suggest an answer

Log in or Sign up to answer