You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi!
I'm working on a project where I have a screen with custom date fields, I would like to use a validator using the jira expression to compare this field to the calendar date.
I tried with this code:
issue.customfield_10057.toCalendarDate() <= new CalendarDate().plusMonths(3).
but it doesn't work
can you help me with this.
Hi @Radia Bouraib ,
I believe you want something like this:
new Date(issue.customfield_10057) <= new Date().plusMonths(3)
You'll need to create a date object from your customfield with new Date() before you can compare it.
The documentation for Jira Expressions is pretty nice, but in my mind nothing beats trying things out yourself. We have a free app called Expression Tester to do just that, give it a try if you like.
Best regards,
Oliver
Hi @Oliver Siebenmarck _Polymetis Apps_
Thank you very much for this expression, my requirement is different but this is helped to resolve my issues. I am comparing two Date & Time fields, Actual End should be less than or equal to Planned End date. I have used below expression and it worked.
new Date(issue.customfield_10009) <= new Date(issue.customfield_10145)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do that within the workflow of your issue type, without the use of an app like the following image:
If you want to use powerscipt to do that real-time, like a behavior short-of-thing, then I would suggest that you should refer to the documentation of powerscript. Unfortunately I haven't use this app.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.