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

JWT Logical Validation in Workflow Create Transition

Lucas Frondorf November 18, 2022

Hi community,

I've got a date picker on a portal form where I want to display an error message if it's past 3pm on the same day. 

After several unsuccessful attempts using a ScriptRunner behavior I'm now trying to configure the requirement using Jira Workflow Toolbox. 

In the workflow's "Create" transition I set up a JWT Logical Validator with the following expression: datePart({issue.cf13310}, LOCAL) = datePart({system.currentDateTime}, LOCAL) ? !(hour({system.currentDateTime}, LOCAL) >= 15) : false

I figured out that the validator must return false in order to show the error message. Hence I check if the current hour is greater or equal 15 and invert that.

However, this does not work at all. Can somebody help?

1 answer

1 accepted

2 votes
Answer accepted
I.Kharab November 18, 2022

Hi @Lucas Frondorf

 

Try using  the following expression instead:

datePart({issue.cf13310},LOCAL) = datePart({system.currentDateTime},LOCAL) AND hour({system.currentDateTime}, LOCAL) < 15 OR datePart({issue.cf13310},LOCAL) != datePart({system.currentDateTime},LOCAL)

Please let me know if this expression gave you the expected results. 

Kind regards,

Iheb Kharab

Decadis AG

Lucas Frondorf November 21, 2022

Thanks! This worked like a charm!

Like I.Kharab likes this
I.Kharab November 25, 2022

Glad to hear!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events