When we want to submit a status, from status A to status B, there is a validation to compare the current date (the day the status was submitted) and the value of the MoA Signed Date field.
- If the current date is less than 3 months from the MoA Signed Date, then JIRA can be submitted.
- If the Current Date is more than 3 months from the MoA Signed Date, then JIRA fails to submit and an error message appears.
is there a simple way to get this validation? (maybe using the Date Compare Validator feature?) or do you have to use the following features: Build-your-own (scripted) Validator (JMWE app)?
please help, and thanks in advance
you can easily implement this using JMWE's Build-your-own (scripted) Validator, using a script like this:
new Date().toCalendarDate() <= issue.customfield_12345.plusMonths(3)
where customfield_12345 is the custom field ID of field MoA Signed Date. This assumes that MoA Signed Date is a Date Only custom field. If it's a Date/Time field, the script would be:
new Date() <= issue.customfield_12345.plusMonths(3)
Did this work for you? If so, could you please "accept" the answer so others can find it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
thank you very much for helping me answer my question.
I have tried the way you told me, using the following query:
new Date().toCalendarDate() <= issue.customfield_12927.plusMonths(3)
because the MoA Signed Date field is a Date Picker.
and issue.customfield_12927 is MoA Signed Dated ID
But I got an error message like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My bad, I forgot that a custom field of that type returns a string. Try this:
!!issue.customfield_12927 && new Date().toCalendarDate() <= new CalendarDate(issue.customfield_12927).plusMonths(3)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
For the query you provided, it works like a charm.
Thank you for your help, God bless you, and your family. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.