Uploaded image for project: 'Automation for Cloud'
  1. Automation for Cloud
  2. AUTO-2013

Support nested branches (branch inside a branch) in Automation rules

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    • 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.

      Here is the result:

        1. resultsasexpected.png
          176 kB
          Hala ElRoumy
        2. rulelogictoloop2fields.png
          483 kB
          Hala ElRoumy

              Unassigned Unassigned
              e0bbe77fe18a Hala ElRoumy (Inactive)
              Votes:
              17 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated: