It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I want to write a groovy script condition to validate if a date is in the future.
the date is not set in the issue. if the user wants to pass the transition, a pop-up appears with a screen where the (empty) date-field is. he puts in a date and if he submits, the date should be checked.
Problem: println says, cfValues['customfield_13430'] is null. so the whole condition breaks and every time returns the defined error message.
can you help me please?
Okay, thank you.
No i can print the correct value (Output: 2013-11-14 00:00:00.0)
But if i compare (as in the screenshot above) i can not pass (but i should, because 2013-11-14 is in the future and i compare to the current date).
And take care, because it's the translated name of the custom field. So if you use translated custom fields you should get the cf on your own (using the id or the unrtanslated name) and read the value directly (issue.getCustomFieldValue(cf)) until https://jamieechlin.atlassian.net/browse/GRV-335 is fixed.
If the custom field is a date field it returns a Timestamp object. This is already a Date object. The getDate() method returns the day of the month (int) not a Date object. So it should be enough to write
cfValues['My Date'] > now
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreAtlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.