Compare between "date picker" custom field and today date {{now}} in automation

Taj Zaid June 22, 2023

Hello everyone,

kinda new to jira and been trying to resolve this for 3\4 days so far.

i am trying to create a scheduled automation rule with the condition that if the date placed  in the custom field equals today date then process continues.

what am i doing wrong - note that  the date value in jira shows like this "june 22,2023" and when click it 6/22/2023 - not sure if this info would help 

provided in the screenshots some of the last tests i been doing but with no results to bypass this  step

 

a1.pnga2.png
z3.PNG
 

1 answer

1 accepted

1 vote
Answer accepted
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 22, 2023

@Taj Zaid , Welcome to the Atlassian Community!

Are the fields you want to compare with {{now}} Date fields only or DateTime fields?

Another thing, are you using any JQL in your scheduled? If yes, why don't you just put in the JQL that the field ITSM-TERM = now() ?

Then you would have a more accurate schedule of events and your condition to compare the date with the current day would be automatically done by JQL, without needing the conditions.

Have you ever tried something like this?

Let me know what is your doubts.

Regards,

Fernando

Taj Zaid June 23, 2023

Hello @Fernando Eugênio da Silva  

Thank you for taking the time to reply to my thread , appreciate your input on this matter.

1- yes i am trying to compare date only " not date and time "

2- the date picker returns value of "MM\DD\YYYY" and comparing it with predefined "now" is not valid hence now returns date and time as default return values - or thats what i have noticed during some tests 

3- am not much familiar with JQL formatting, if you have any resource \ cheat sheet might be benifical to study from would be great 

like what is the diffrence between typing in JQL 

ITSM-TERM = now() 
OR
ITSM-TERM = {{now}}

Good news - somehow the code worked over night and gave correct results - now am trying to understand why it worked

 

so i have done the code as follows during the night and tested it using the " RUN" button that pops up in the automation after publishing in the top right corner - each time i run it i used to get this error ( even the date was 23\6\2023 ) and my geo-location date is also 23\6\2023

so now i am suspecting from where does the "NOW" function takes its time from? - my tests were done somewhere after midnight - begging of 23\6\2023

or maybe there is a bug in the RUN button and have to wait for the original trigger to happen ?

Note:- i have changed the custom filed name from ITSM-TERM to TermDate , as i thought that JQL might comfier the dash as an operator that might cause unexpected behavior

x1.PNG

 

provided below is scheduled date \ success value for the code run \ and the condition that worked with the date picker
.

s1.PNG

 

s2.PNG


Apologize for the detailed long reply - am trying to document this in best way possible so that it can be helpful for the rest as well in the future. 

appreciate your insight on this and looking forward to hearing from you. 

Kind Regards
Taj

Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 23, 2023

@Taj Zaid 

Good news! I follow a philosophy that a team that is winning doesn't move lol

This Atlassian ecosystem is huge and you will definitely learn a lot from the community. Just fly!

Like Taj Zaid likes this

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