Comparing Issue dates in Jira Automation

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

This article looks into the challenge of comparing date fields in Jira issues, such as creation dates, due dates, and start dates, with fixed date strings. In many automation scenarios, it's important to check whether a date falls within a certain range to trigger specific actions.

The main challenge is that Jira Automation doesn't allow direct comparisons using < or > operators on dates formatted as strings. Instead, you need to find workarounds that treat the dates in a way that supports numerical comparison or use alternative methods to compare them.

Solution

Compare dates using JQL

To address this issue, it is necessary to use Jira's built-in JQL (Jira Query Language) conditional rule, which can compare dates numerically. JQL accepts fixed dates as strings in specific formats that Jira can interpret correctly for comparisons. The acceptable date formats for JQL are 'yyyy/MM/dd', 'yyyy-MM-dd', 'yyyy/MM/dd', and 'yyyy-MM-dd'.

Suppose the rule should assign issues to a sprint based on whether the creation date is after June 3, 2024. Instead of using direct date comparisons in the automation rule, use JQL to handle the date comparisons. To check if the issue's created date is:

  • greater than a specific date: created > "2024-06-03"

  • less than a specific date: created < "2024-06-03"

In an automation rule, you could use a condition like "{{issue.created.format("dd/MM/yyyy")}} is less than 05/06/2024", using date and time smart values.

Jira Automation rules can't directly compare date strings due to their treatment as non-numeric strings. Using JQL for date comparisons provides a viable workaround, allowing for accurate conditional checks and appropriate sprint assignments. This approach ensures that automation rules function as intended, avoiding incorrect sprint assignments based on creation dates.

Updated on May 1, 2025

Still need help?

The Atlassian Community is here for you.