Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Automatically set Expected Due Date to 3 business days from Created Date, exclude weekends

Hi There! I'm trying to update my Expected Due Date field to be 3 business days from the Created Date. This is just a date field (not date/time). I want to exclude weekends (Saturday and Sunday) when calculating the Expected Due Date.

I do have access to ScriptRunner and JMWE to set up this post-function; I'm just unfamiliar with Groovy expressions. I'm using Jira Server v7.10.1.

Any advice would be greatly appreciated!

1 answer

1 accepted

0 votes
Answer accepted
Payne Community Leader Jan 24, 2019

Hi Lauren,

Have a look at

Create a JMWE Scripted Operation post function on your Create transition. Field will be Due Date, Value Type will be Groovy Expression, and Value will be that script, with the final line being date(new Date(),3)

Hope this helps,


Huge help :) Thank you, Payne!

Hi @Payne ! I'm now trying to customize this a bit further. If a user inputs the ticket after 4:00 PM EST, I want to add an additional business day to the due date. I'm currently using the code provided in the link you sent over. Do you have any advice on how to customize?

Thanks, Lauren

Payne Community Leader Feb 20, 2019

Hi Lauren,

So, what you want to do is send an argument of 4 days rather than 3 days if the current hour is 4pm or greater (16 on a 24-hour clock). So, here's one approach; change your final line where you call date(from,nod) to:

Calendar cal=Calendar.getInstance();
def hour = cal.get(Calendar.HOUR_OF_DAY)
def numDaysToAdd = 3 + (hour >= 16 ? 1 : 0)
date(new Date(),numDaysToAdd)

You may not recognize (hour >= 16 ? 1 : 0) ; that's using the ternary operator, which is a way to shortcut an if-then-else construct.

condition ? value if true : value if false

Hope this helps,


Like David Denney likes this

Thank you @Payne ! Really appreciate it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

312 views 9 7
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