copy datetime field to "due date" field

JiraYo
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.
March 21, 2019

Hey i have a custom field that has a date and time value like '2021-04-30 18:30:00.0'

i want to copy the DATE portion only to the due date field

i can use the copy field JMWE function, but how do i strip the date out?

jira seems to want it in the format "d/MMM/yy" and will fail with a straight copy saying "invalid date format".

 

how do i transform this value using groovy or some other method?

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2019

Have you tried using the Copy Value From Field To Field post-function directly? It will strip the time portion automatically.

JiraYo
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.
March 22, 2019

yup worked. perfect. glad to see it can handle this natively without over thinking it!

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2019

However, be careful about one thing: time zones. Jira handles Date objects (which contain date+time info) on the UTC time zone. So 2021-04-30 18:30:00.0 might end up being converted to 2021-05-01 if you are in the PST time zone and thus your date/time value is 2021-04-30 18:30:00.0-08:00

Suggest an answer

Log in or Sign up to answer