Forums

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

How can I compare the jiradate to the current day?

Dom Malgieri January 12, 2022

Capture.PNG

Im trying to do a advance compare for todays date specifically and it keeps telling me the condition doesnt match. My end goal is to apply this logic to tell a rule that if the jiradate = 12/25/2022 then dont run.

1 answer

1 accepted

3 votes
Answer accepted
Alex Koxaras -Relational-
Community Champion
January 12, 2022

Hi @Dom Malgieri 

I'm not quite sure what is it that you want to achieve.

{{now.jiraDate}} yields today's date (now) in the jira format. What you are trying to do is to compare the now date with an expression that returns null ({{now.jiraDate.12/01/2022}}). So what is it that you want to compare? Today's date with a specific date?

Dom Malgieri January 12, 2022

Correct, or rather a string of dates...holidays but if I need to compare them individually thats fine. I just cant seem to get it to compare the current date to a set date. I set the others date as today to see if I could get it to work instantly and then from there i could adjust the date as needed.

Alex Koxaras -Relational-
Community Champion
January 12, 2022

Then try this:

compare datespng.png

Dom Malgieri January 12, 2022

Success. Much appreciated. Is there a way to do multiple dates or can it only be one date at a time?

Alex Koxaras -Relational-
Community Champion
January 13, 2022

Multiple dates or multiple ifs?

Dom Malgieri January 13, 2022

dates. I think i got it though by putting or between each date on the second value

Alex Koxaras -Relational-
Community Champion
January 14, 2022

Good to know!

But in case it doesn't work, try using "contains regex" instead of "equals", and as the second values type something like this: 

(2022-01-12|2022-01-14)

where all the dates you want to compare are separated by a |

 

Kindly mark my answer as accepted in order to help other find proper answers!

Cheers!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events