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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,539
Community Members
 
Community Events
176
Community Groups

compare a date custom fields validator using jira expression

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. 

2 answers

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)

0 votes

Hi @Radia Bouraib are you using Scriptrunner?

You can do that within the workflow of your issue type, without the use of an app like the following image:

date compare.png

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.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events