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,
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")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I could help.
If your problem has been solved please consider clicking the Accept Answer button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.