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,557,867
Community Members
 
Community Events
184
Community Groups

How do I automatically set the Due Date of an issue via a workflow post funtion

I would like the due date of an issue to be automatically set to now() via a post function - ie, any issue created today are due today.

I believe that the way to do this is via the script runner Plugin and to run a Custom Script Post Function from the Create state but the scripts that I have found online do not work.

Can anyone help me with what script I would use to achieve this.

 

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Sam Hall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 17, 2017

Hi Frank,

There are some alternatives:  

If you are sticking with ScriptRunner for JIRA, did you try the following?:

issue.setDueDate(new Timestamp((new Date()).time))

Adapted from: https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/postfunctions/set-issue-attributes.html and also: https://answers.atlassian.com/questions/32996494

Hope this helps.

Sam

Awesome - thanks Sam!

I used the first option, tested and works perfectly,

thank you

Is there really no native way to do this? That's mental.

We have a cloud install, so most options here are not available, or require an add-on purchase which just feels a bit like taking a nuclear bomb to kill a mole in your back yard.

Like # people like this

Atlassian!!! How can you have native ability to post function estimates and time spent, but NOT due date?!?! 

Interesting, should be fairly easy to implement. It's a crucial option for some issue types, like Decisions.

Like Tim McGrath likes this

is there a way for me to add automatic due dates to each tickets/story without doing some coding here? I am not a techie person and not familiar with coding. I am so basic, help me out here. Isnt supposed to be able to set automatic due dates

TAGS
AUG Leaders

Atlassian Community Events