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

Validate ticket creation time in JQL

Harold Levasseur September 20, 2023

I would like validate the creation time of a ticket for action A or B in JQL when ticket is create.

I founded {{now.convertToTimeZone("America/Montreal").shortDateTime}} gives me the date time at the moment and it's look like : 9/20/23, 3:19 PM

I would like to create a IF in JQL that validate if ticket creation time is between 8h00 and 16h00 and the day is from monday to friday.

Somebody can show me how can I extract the time and the day of week to compare?

 

Thanks,  

 

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2023

Hello @Harold Levasseur 

Welcome to the Atlassian community.

If you reference the Format section of this document:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#--

...it provides a link to additional formatting commands at

https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html

Using that information you will find that you can extract the day-of-week from a date/time field using .format("E")

{{now.convertToTimeZone("America/Montreal").format("E")

You can extract the hour, 0-24, using "H".

{{now.convertToTimeZone("America/Montreal").format("H")

Harold Levasseur September 21, 2023

It works well 

Thanks Trudy,

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 21, 2023

Glad I could help.

If your problem has been solved please consider clicking the Accept Answer button.

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