-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Rule - Smart Values
-
Severity 3 - Minor
-
Jira Software
Issue Summary
There is an issue with smart value comparison in Automation. Comparing two date fields using variables results in unexpected outputs. The compareTo function is being used.
When comparing the fields directly, the result is correct. However, using variables the function is returning incorrect results.
Steps to Reproduce
- Create an issue in Jira Cloud with two date picker fields, e.g., "Start date" and "Due date". Set both fields to the same value, such as 2025-08-01.
- Use the smart value expression {{issue.Start date.compareTo(issue.Due date)}}. Observe that the result is 0, indicating correct comparison.
- Create variables {{startDateVar}} and {{dueDateVar}}, assigning them {{issue.Start date}} and {{issue.Due date}}, respectively.
- Use the expression {{startDateVar.compareTo(dueDateVar)}}. Observe that it returns an empty result.
- Use the expression {{startDateVar.toDate.compareTo(dueDateVar.toDate)}}. Observe that it incorrectly returns 14 instead of the expected 0.
Expected Results
The compareTo method should return 0 when both dates are the same, regardless of whether direct fields or variables are used for comparison.
Actual Results
The compareTo method returns 14 when using variables with .toDate, indicating a discrepancy in the date comparison.
Workaround
Currently there is no known workaround for this behavior.