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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Difference between today and custom date field

Hi, Requirement - If 'Planned start date' (custom field) is less than two days from now, and 'Env' (custom field) is 'PRD', then only Emergency change category ticket can be created.

I'm writing a JMWE scripted workflow validation to achieve this (not a scripting expert)

if (issue.get("Env") == "PRD")
{ if ((issue.get("Change category") != "Emergency"))
{(issue.get("Planned start date") > new Date() +2)
}}

The problem with this is, that even if Change category is selected as Emergency, it does not allow the ticket creation. What am I doing wrong? Pls help.

1 answer

1 accepted

0 votes
Answer accepted

Hi Himanshu,

I believe what you want is:

issue.getAsString("Change category") != "Emergency" || issue.getAsString("Env") != "PRD" || issue.get("Planned start date") > new Date() +2

Had to make a slight logical adjustment to your recommendation, but worked like a charm. Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

163 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you