Hello everyone,
One of the most commonly asked questions we receive here in the Jira Automation team is whether or not it is possible to branch over smart values. We are very excited to announce that we have introduced a new feature, called Advanced Branching, which now allows this functionality! (Jira Cloud only)
Why would you do that?
Some of the use cases this addresses:
-
Iterating over a list, such as a list of issues from Lookup Issues action, and performing an action on each of these issues
-
Filtering lists using conditions to only perform actions on items which match
-
Branching on any list or single object that is available in the smart value context, such as comments, versions, users etc.
How do I do it?
The Branch component now has two different branching options, the usual Branch rule / related issues, and the new Advanced branching
Selecting Advanced branching will present you with options to configure your branch. You specify the smart value you want to branch on, such as {{issue.comments}}.
Next, you specify a variable smart value name to use inside the branch, which will be the smart value you use to access the branched item. For example, if you were to branch on {{issue.comments}}, you might want to call it myComment.
Now, inside the branch, you can use the smart value {{myComment}} to access each comment in the list of {{issue.comments}}. The new smart value created is the full object from the original smart value, so you can access fields and methods on the branch object, such as {{myComment.body}}.
Where can I find more information?
There are a lot of advanced use cases this feature enables. For more information about branching and smart values, here are some documents which you may find helpful:
And of course, if you have any difficulties or want further information, please don’t hesitate to chat to us here in the community and comments below, or reach out via support.
Cheers!
Sam
49 comments