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

Add support for 'AND' and 'OR' conditional logic smart value for more than two conditions

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

      Issue Summary

      According to the article conditional-logic/#or, it is currently possible to check for two conditions using the 'OR' or 'AND' condition logic, however, it is not possible to check for more than two conditions. 

      Steps to Reproduce

      1. Create an Automation rule
      2. Specify below conditional smart value
        {{#if(or(smartValue1, smartValue2, smartValue3))}} returned value {{/}} 
      1. Check audit log

      Expected Results

      If any one of the smartValue1, or smartValue2 or smartValue3 return true, it should return true.

      Actual Results

      The evaluation process is skipped and nothing is done.

      Workaround

      1. Specify like below:

      {{#if(smartValue1)}} returned value {{/}} 
      {{#if(smartValue2)}} returned value {{/}} 
      {{#if(smartValue3)}} returned value {{/}} 
      {{#if(smartValue4)}} returned value {{/}} 
      


      2. Use if/else conditional block

            [AUTO-1643] Add support for 'AND' and 'OR' conditional logic smart value for more than two conditions

            Jun Itokawa made changes -
            Description Original: h3. Issue Summary

            According to the article [conditional-logic/#or|https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and:~:text=Popular%20issue.-,or,-Syntax], it is currently possible to check for two conditions using the '{*}OR'{*} condition logic, however, it is not possible to check for *more than* two conditions. 
            h3. Steps to Reproduce
             # Create an Automation rule
             # Specify below conditional smart value
            {code:java}
            {{#if(or(smartValue1, smartValue2, smartValue3))}} returned value {{/}} {code}
             # Check audit log

            h3. Expected Results
            If any one of the smartValue1, or smartValue2 or smartValue3 return true, it should return true.

            h3. Actual Results
            The evaluation process is skipped and nothing is done.

            h3. Workaround

            1. Specify like below:
            {code:java}
            {{#if(smartValue1)}} returned value {{/}}
            {{#if(smartValue2)}} returned value {{/}}
            {{#if(smartValue3)}} returned value {{/}}
            {{#if(smartValue4)}} returned value {{/}}
            {code}

            ---
            2. Use if/else conditional block
            New: h3. Issue Summary

            According to the article [conditional-logic/#or|https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and:~:text=Popular%20issue.-,or,-Syntax], it is currently possible to check for two conditions using the '{*}OR'{*} or '{*}AND{*}' condition logic, however, it is not possible to check for *more than* two conditions. 
            h3. Steps to Reproduce
             # Create an Automation rule
             # Specify below conditional smart value
            {code:java}
            {{#if(or(smartValue1, smartValue2, smartValue3))}} returned value {{/}} {code}

             # Check audit log

            h3. Expected Results

            If any one of the smartValue1, or smartValue2 or smartValue3 return true, it should return true.
            h3. Actual Results

            The evaluation process is skipped and nothing is done.
            h3. Workaround

            1. Specify like below:
            {code:java}
            {{#if(smartValue1)}} returned value {{/}}
            {{#if(smartValue2)}} returned value {{/}}
            {{#if(smartValue3)}} returned value {{/}}
            {{#if(smartValue4)}} returned value {{/}}
            {code}

            2. Use if/else conditional block
            Jun Itokawa made changes -
            Summary Original: Add support for OR conditional logic smart value for more than two conditions New: Add support for 'AND' and 'OR' conditional logic smart value for more than two conditions
            Jun Itokawa made changes -
            Link Original: This issue is cloned from AUTO-1223 [ AUTO-1223 ]
            Jun Itokawa made changes -
            Description Original: h3. Issue Summary

            According to the article [conditional-logic/#or|https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and] ,it is currently possible to check for two conditions using the '{*}OR'{*} condition logic, however, it is not possible to check for *more than* two conditions. 
            h3. Steps to Reproduce
             # Create an Automation rule to check for custom fields of a linked issue
             # When we use the 'AND' conditional operator to check for two conditions, it works fine
            Example: 
            {code:java}
            {{#issue.issuelinks}} {{#if(and( Issue.TEXT_A.equals("AAA") , Issue.TEXT_B.equals("BBB") ))}} YES {{Issue.TEXT_A}} {{Issue.TEXT_B}} YES {{/}} {{#if (not (equals (Issue.TEXT_A, "AAA")))}} OHHH {{Issue.TEXT_A}} {{Issue.TEXT_B}} OHH {{/}} {{/}}{code}

             # When we use the 'AND' conditional operator to check for more than two conditions, the condition is not successful
            Example: 
            {code:java}
            {{#issue.issuelinks}} {{#if(and( Issue.TEXT_A.equals("AAA") , Issue.TEXT_B.equals("BBB"), Issue.TEXT_C.equals("CCC") ))}} YES {{Issue.TEXT_A}} {{Issue.TEXT_B}} YES {{/}} {{#if (not (equals (Issue.TEXT_A, "AAA")))}} OHHH {{Issue.TEXT_A}} {{Issue.TEXT_B}} OHH {{/}} {{/}}{code}

            h3. Expected Results

            The 'AND' conditional operator should work even if we check for more than two conditions as mentioned in the above example.

            (or)

            There should be a way to nest the 'AND'/'OR' operator to check for more than three conditions.
            h3. Actual Results

            When we use the 'AND' conditional operator to check for more than two conditions, the condition is not successful 
            h3. Workaround

            Currently, there is no known workaround for this behavior. A workaround will be added here when available
            New: h3. Issue Summary

            According to the article [conditional-logic/#or|https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and:~:text=Popular%20issue.-,or,-Syntax], it is currently possible to check for two conditions using the '{*}OR'{*} condition logic, however, it is not possible to check for *more than* two conditions. 
            h3. Steps to Reproduce
             # Create an Automation rule
             # Specify below conditional smart value
            {code:java}
            {{#if(or(smartValue1, smartValue2, smartValue3))}} returned value {{/}} {code}
             # Check audit log

            h3. Expected Results
            If any one of the smartValue1, or smartValue2 or smartValue3 return true, it should return true.

            h3. Actual Results
            The evaluation process is skipped and nothing is done.

            h3. Workaround

            1. Specify like below:
            {code:java}
            {{#if(smartValue1)}} returned value {{/}}
            {{#if(smartValue2)}} returned value {{/}}
            {{#if(smartValue3)}} returned value {{/}}
            {{#if(smartValue4)}} returned value {{/}}
            {code}

            ---
            2. Use if/else conditional block
            Jun Itokawa made changes -
            Description Original: h3. Issue Summary

            According to the article [conditional-logic/#and|https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and] ,it is currently possible to check for two conditions using the '{*}and'{*} condition logic, however, it is not possible to check for more than two conditions. It is also not possible to nest the *and* condition as well.
            h3. Steps to Reproduce
             # Create an Automation rule to check for custom fields of a linked issue
             # When we use the 'AND' conditional operator to check for two conditions, it works fine
            Example: 
            {code:java}
            {{#issue.issuelinks}} {{#if(and( Issue.TEXT_A.equals("AAA") , Issue.TEXT_B.equals("BBB") ))}} YES {{Issue.TEXT_A}} {{Issue.TEXT_B}} YES {{/}} {{#if (not (equals (Issue.TEXT_A, "AAA")))}} OHHH {{Issue.TEXT_A}} {{Issue.TEXT_B}} OHH {{/}} {{/}}{code}

             # When we use the 'AND' conditional operator to check for more than two conditions, the condition is not successful
            Example: 
            {code:java}
            {{#issue.issuelinks}} {{#if(and( Issue.TEXT_A.equals("AAA") , Issue.TEXT_B.equals("BBB"), Issue.TEXT_C.equals("CCC") ))}} YES {{Issue.TEXT_A}} {{Issue.TEXT_B}} YES {{/}} {{#if (not (equals (Issue.TEXT_A, "AAA")))}} OHHH {{Issue.TEXT_A}} {{Issue.TEXT_B}} OHH {{/}} {{/}}{code}

            h3. Expected Results

            The 'AND' conditional operator should work even if we check for more than two conditions as mentioned in the above example.

            (or)

            There should be a way to nest the 'AND'/'OR' operator to check for more than three conditions.
            h3. Actual Results

            When we use the 'AND' conditional operator to check for more than two conditions, the condition is not successful 
            h3. Workaround

            Currently, there is no known workaround for this behavior. A workaround will be added here when available
            New: h3. Issue Summary

            According to the article [conditional-logic/#or|https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#and] ,it is currently possible to check for two conditions using the '{*}OR'{*} condition logic, however, it is not possible to check for *more than* two conditions. 
            h3. Steps to Reproduce
             # Create an Automation rule to check for custom fields of a linked issue
             # When we use the 'AND' conditional operator to check for two conditions, it works fine
            Example: 
            {code:java}
            {{#issue.issuelinks}} {{#if(and( Issue.TEXT_A.equals("AAA") , Issue.TEXT_B.equals("BBB") ))}} YES {{Issue.TEXT_A}} {{Issue.TEXT_B}} YES {{/}} {{#if (not (equals (Issue.TEXT_A, "AAA")))}} OHHH {{Issue.TEXT_A}} {{Issue.TEXT_B}} OHH {{/}} {{/}}{code}

             # When we use the 'AND' conditional operator to check for more than two conditions, the condition is not successful
            Example: 
            {code:java}
            {{#issue.issuelinks}} {{#if(and( Issue.TEXT_A.equals("AAA") , Issue.TEXT_B.equals("BBB"), Issue.TEXT_C.equals("CCC") ))}} YES {{Issue.TEXT_A}} {{Issue.TEXT_B}} YES {{/}} {{#if (not (equals (Issue.TEXT_A, "AAA")))}} OHHH {{Issue.TEXT_A}} {{Issue.TEXT_B}} OHH {{/}} {{/}}{code}

            h3. Expected Results

            The 'AND' conditional operator should work even if we check for more than two conditions as mentioned in the above example.

            (or)

            There should be a way to nest the 'AND'/'OR' operator to check for more than three conditions.
            h3. Actual Results

            When we use the 'AND' conditional operator to check for more than two conditions, the condition is not successful 
            h3. Workaround

            Currently, there is no known workaround for this behavior. A workaround will be added here when available
            Jun Itokawa made changes -
            Summary Original: Add support for And conditional logic smart value for more than two conditions New: Add support for OR conditional logic smart value for more than two conditions
            Jun Itokawa made changes -
            Reporter Original: Rohit Sreedharala [ 9c3330e8be50 ] New: Jun Itokawa [ d20fb9d86b65 ]
            Jun Itokawa made changes -
            Link New: This issue is cloned from AUTO-1223 [ AUTO-1223 ]
            Jun Itokawa created issue -

              Unassigned Unassigned
              d20fb9d86b65 Jun Itokawa
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: