I need to be able to set the due date of Sub-tasks based on the Due date of the Parent. Ideally this needs to be 5 working days before. I currently have the code below which sets the due date on the parent to be 30 days after the date entered in Custom field "Received Date". I have been trying to reuse it for the sub task date auto set mentioned above but I'm not having any luck! Any ideas would be greatly appreciated!
int days = 30;
Calendar dueDate = Calendar.getInstance();
dueDate.setTime( (Date) issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Received Date")));
while (days != 0)
if((dueDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) || (dueDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY))
issue.setDueDate (new Timestamp (dueDate.getTime().getTime()));
Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...
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