I am trying to have a date field on the parent issue get set to 60 days from the current date when a sub-task is set to the Done status. I'm not copying a field from the sub-task, so I added a Groovy script post function from JMWE and added the following:
import com.atlassian.jira.component.ComponentAccessor
import java.sql.Timestamp
issue.parentObject.setDueDate(new Timestamp((new Date() + 60).time))
//issue.parentObject.getKey();
//issue.parentObject.getDueDate();
Using the bottom two lines I tested the script to make sure it was pulling the sub-tasks parent issue key, and then I tested what the parent due date field would be and it all checked out. However, whenever I mark this sub-task as done nothing happens. I even have it set to fail the transition if there is an error in the post-function, but that doesn't even happen. Am I missing something in my script or is there possibly a better way to do this?
You should instead use the Set Field Value of Linked Issues post-function, pick the Due Date field and the "is subtask of" link type, and specify this as the value:
new Date() + 60
I saw that post function type, but didn't investigate it enough apparently. In my head I thought it would set all linked issues. I did not realize you could specify the link type or add custom Groovy.
Just set it up as you said and it works perfectly. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discover the teamwork and precision behind success on and off the track. See how this high-performing team makes the impossible possible. Be one of the first 100 customers to register for a chance to win 2 tickets to an Atlassian Williams 2026 race.
Register now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.