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

Comparing dates in automation

jan.ambroz November 6, 2023

Hi there, 

 

I have automation that fetches data from Jira REST API and I would like to compare some dates from the response and one Issue date field. 

Screenshot 2023-11-06 at 2.45.17 PM.png

 

 

I am creating two variables:

  • sprintStartDate => {{sprint.startDate.substring(0,10).toDate.jiraDate}}
  • scheduledDate => {{issue.Date Scheduled}}

The output of these variables are :

2024-04-18
2024-04-17

 

If I use any function to compare these dates it never passes the condition. I guess I am not sending the dates correctly into compare function. 

 

I tried: {{scheduledDate.isAfter(sprintStartDate)}} but no output. 

 

How to format these dates to use them in the "Advanced compare condition"?

 

Thank you.

1 answer

1 accepted

2 votes
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 6, 2023

Hi @jan.ambroz 

as fsr as i know variables are stored as type of String. Therefore I would suggest to re-convert to date with .toDate in your comparison.

Best
Stefan

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Upcoming Jira Events