Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automations: Date isAfter operator not returning a truthy type?

Nicholas Coriale July 13, 2023

Hello, I am working on an automation rule using smart values. I am trying to check if a date is after another date, and then use the result of that comparison in an or operator. However, every time I use the result of .isAfter in a conditional check, it acts as if it is false, not true. 

If log the result of {{issue.sprint.endDate.isAfter(issue.Target End.toDate)}} I get true

However if I log the result of {{equals(issue.sprint.endDate.isAfter(issue.Target End.toDate), true)}} I get false

I am not sure why true does not equal true? Per the documentation it returns the value true, not a string of true, but I tired a string comparison and that returns false as well. 

 

My ultimate goal is to see if target end is NULL OR if target date is before the date of the issues sprint end. 

{{or(equals(issue.Target End, NULL), issue.sprint.endDate.isAfter(issue.Target End.toDate))}}

1 answer

0 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 13, 2023

Maybe equals doesn't recognize booleans?

Cause I think it might work without having to explicitly evaluate for true?

{{#if(or(issue.Target End, NULL), issue.sprint.endDate.isAfter(issue.Target End.toDate))}}YUP{{/}}
Nicholas Coriale July 13, 2023

I tried using isAfter with IF, and it never evaluated true and ran what was in the if. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events