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

JMWE - Check Current Time before allowing Creation

Julian Governale
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

We would like to use the build-your-own validator to check if the current time is before 16:00 UTC and the printer selection is Day Print. 

If its 16:00 or later, then we block the issue creation since Day prints are not possible after 16:00 UTC. 

What is the syntax to check if the current time is after 16:00 in JMWE? We have tried the following with no luck

Validator

getUTCHours() < new Date(["16:00:00"])

Conditional Validation

!! issue.customfield_11947 && issue.customfield_11947.value == "Day Print"

2 answers

2 accepted

3 votes
Answer accepted
Maciej Dudziak _Forgappify_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

Hi @Julian Governale 

If that's a Jira expression, then you can use following:

new Date().getUTCHours() > 16

Cheers 

Julian Governale
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

Thank you, this is what i was looking for, but just less than "<"

Like • 2 people like this
0 votes
Answer accepted
Layssa Souza
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

Hi @Julian Governale ,

 

See if this condition validation works for you:

!!issue.customfield_11947 && issue.customfield_11947.value == "Day Print" && new Date().getUTCHours() < 16

OR ELSE:



(issue.fields.customfield_11947 and issue.fields.customfield_11947.value == "Day Print")
and (issue.fields.created | date("HH", "UTC") | int >= 16)
 

 Best regards.

Julian Governale
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

Thank you for the response, it was just 16 that I was looking for so marking your as accepted as this does work

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Events