Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing Dates

Rob Sirard May 14, 2019

I tried using the syntax below in a JQL Condition.

{{issue.Estimated Latest Delivery Date}} > {{issue.Target Date}}

Audit Log say:

"(key IN (KIK-23) AND (2019-05-31 > 2019-05-01))" - Field '2019-05-31' does not exist or you do not have permission to view it.

Looking online it does not look like you can compare dates in JQL.  So I tried using Advance Compare Condition with {{issue.Estimated Latest Delivery Date}} in the first condition and {{issue.Target Date}} in the second condition.  Problem is that the Condition field does not support the > operator.

Comparing dates is something many folks must do.  I must be missing something obvious.

1 answer

0 votes
Victor Seger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2019

Hello Robert,

We have a few ways of comparing dates in Automation for JIRA. 

Can you take a look into this documentation and check if it suits your needs: https://docs.automationforjira.com/working-with-issue-data/date-functions.html#comparing-two-dates

I'd suggest you to take a look specifically into the "isAfter" and "isBefore" date functions on the doc I've sent you.

Please let me know if you have any other questions.

Cheers,

Victor

Rob Sirard May 15, 2019

Thanks Victor.  I have seen that page.  My question is where do I put this sort of logic?

{{issue.Estimated Latest Delivery Date.isafter(issue.Target Date)}}

JQL Condition does not accept it and Advanced Compare does not allow greater than as an operation so I'm not sure I understand where it goes?

Victor Seger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2019

Hi Robert,

You can use this logic inside Advanced compare condition, like below:

Screen Shot 2019-05-16 at 10.37.11.png

This configuration means that the log will only be shown in the logs if the Due Date of the issue is some day after the issue Created Date.

You have to equals it to true in order to make the logic work, but you can also use false as an option if you want to do the reverse logic.

Hope that it helps!

Let me know if you have any doubts about this.

Cheers,

Victor 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events