JQL Syntax to Check the Deployment Date (Field) Is Greater Than 24h or 1d

EXIMBANK May 9, 2017

We have an inline validator script on Create to allow submission if the deployment date is more than 24h in advance.

cfValues['Deployment Date/Timne']?.value > "1d"

Can you please advise why this is not working?

Thank you.

 

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2017

It's because date and time are stored in, well, date/time format.  Not the "pretty" format that JIRA displays and accepts input in.  Even if it returned a pretty date format, a simple ">" is not going to understand it.  And you have not told it what your 1d is relative to either.

I can't remember if the return value is seconds or milliseconds, but it will be a large number representing the number of them elapsed since a base date.

Your code should do something more like "value > ( now + (24 x 60 x 60) )".  (This is for seconds, of course, you may need to multiply it by a further 1,000 for milliseconds)

0 votes
Sam Hall
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.
May 9, 2017

Are you using a add-on for the script?

Suggest an answer

Log in or Sign up to answer