Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-1148

The conditional logic of smart values, "equals" is not returning true for two equal inputs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 9.2.5
    • 9.0.7
    • Smart-values
    • Severity 2 - Major

      Issue Summary

      On Automation for Jira version 9.0.7, the conditional logic of smart values, "equals" is not returning true for two inputs that are equal. If we use the conditional logic below to test if the two inputs are not equal, which they are actually equal, it returns true instead.
      This issue is not reproducible on the latest version of the Automation for Jira app (9.2.5), as well as Jira Data Center 10.3.7 (Automation for Jira 10.3.4).

      Steps to Reproduce

      1. Create an automation rule to test the conditional logic of smart values, "equals" with the example configuration below or import from automation-rule-2-202507171209.json .
        WHEN: Manually triggered
        THEN: Create variable
              Variable name: A
              Smart value: {{reporter.displayName}}
        AND: Create variable
             Variable name: B
             Smart value: {{assignee.displayName}}
        AND: Create variable
             Variable name: result
             Smart value: {{#if(equals(A, B))}} match {{/}}
        AND: Add value to the audit Log
             Log message: A is {{A}}, B is {{B}}. Result is {{result}}.
        AND: Add comment to issue
             Comment: {{#if(equals(A, B))}} Result is {{result}}. Please reassign this issue. {{/}}
        If: Compare two values
            Checks if: {{A}} equals {{B}}
        Then: Add comment to issue
              Comment: The reporter shouldn't be the assignee. Please reassign this issue.
        
      2. Trigger this rule from an issue where the issue reporter is also the issue assignee.
      3. Verify if any comment is added from the automation rule and check the rule's audit log.

      Expected Results

      • Two comments are added to the issue. One is "Result is match. Please reassign this issue.", and another one is "The reporter shouldn't be the assignee. Please reassign this issue.".
      • The rule is executed without any errors in the audit log.
      • The variable, {{result}} returns the string "match", which proves that the two inputs (assignee and reporter) are equal.

      Actual Results

      Only one comment is added to the issue, which is from the "Comment on issue" action after the "Advanced compare condition". The "Comment on issue" action which contains the conditional logic results in an error, as the output is empty (which is incorrect). The conditional logic didn't return the expected result even though the two input are equal.

      • If we use the conditional logic below to test if the two inputs are not equal, which they are actually equal, it returns true instead ("not match" will be printed).
        {{#if(not(equals(A, B)))}} not match {{/}}
        

      Workaround

      • Use the "Advanced compare condition" if applicable
      • For Jira Data Center version below 10, update the Automation for Jira app to version 9.2.5 using UPM: Updating an app.

              ad6a80463119 Amisha
              michin Michelle Chin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: