-
Suggestion
-
Resolution: Unresolved
-
-
Jira Software
Problem
Currently Automation doesn't support nested branches.
Suggestion
Add the feature to support nested branches (a branch within a branch) in Automation. This feature helps in different use cases.
Workaround
To work around this, you can combine a branch with if conditions to achieve the logic of looping through two fields. Here's an example:
If you want to loop through two multi-select fields and create new work items for each combination of values between the two fields.
Here's how the rule is configured:
- The branch is used to loop through one of the fields i.e Brand - Market
- Then I used multiple if condition to check the values of the other field i.e Brand Requirement. This was done using smart values for lists:
{{issue.customfield_10512.get(0)}}
- In my tests, I assumed that the Brand Requirement can have up to 3 values. Therefore, I used 3 If conditions to check if the values exists or empty:
{{issue.customfield_10512.get(0)}},{{issue.customfield_10512.get(1)}},{{issue.customfield_10512.get(2)}}
You can add more if conditions up to the maximum number of values expected to that field. If this field has too many values, then you can use this field in the branch and use the other field "Brand - Market" in the if conditions.
- is related to
-
AUTO-67 Support for more complex logic in Automation rulebuilder, e.g. introduce nested if/else blocks (branches within branches)
- Closed