Modify set due date groovy script to set due date time as well as date

I'm trying to set an issues DateTime field at issue creation time based on priority. I've started by using Mizan's script in this question: https://answers.atlassian.com/questions/27052/customize-priority-based-on-custom-field

However I want the datetime to be set more granularly. 1 hour for Critical, 2 Hours for high etc. I've modified the script sucessfully to use my own priorties but I can't figure out how I can set the due date time to be set as well as the date. Is this even possible?

1 answer

1 accepted

This widget could not be displayed.

Short answer: No - Due Date is capable to store only date part - see https://jira.atlassian.com/browse/JRA-11770

Longer answer: You can of course create another datetime custom field and use it instead (along with) Due Date in your filters and computations. As various SLA plugins on Marketplace do.

EDIT - Short answer should be (thanks Jamie): Due Date is capable of storing date time (as it is Timestamp), but will be formatted as a date (that JRA-11770 about).

Actually to be fair you've answered at least part on my question so I'll edit it to reflect that, and accept your answer and raise a new one.

Thanks Jozel. If I had budget for a paid for plugin I'd certainly be going with that for ease and support but I don't so I have to hand-craft it. So I guess I have to re-phrase my question to reflect using a separate datetime custom field.

What Jozef said is true, but the actual storage for the duedate is a Timestamp, so date and time. However the UI does not display the time portion.

And in fact in the answer to Graham's other question, someone has provided code that sets the duedate (including hours), even though Graham asked about a custom field. So we're kind of come full circle.

That's interesting. Not being a coder of any stripe and not having time yet to test it I wasn't able to interpret it as such. By the way I love your icon, and your work.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

139 views 2 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you