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,368,495
Community Members
 
Community Events
168
Community Groups

Adjust parents due date automatically to the nearest due date of one of the sub-tasks

Hi everyone, hope someone can help me.

Within my jira project, I have several Stories, Tasks and sub-tasks. With Jira automation, the story/task will be automatically progressed when all of the sub-tasks are done (for example). 

But now I'm facing an issue which I'm not able to solve. Hope that someone within this community can help.

I would like to make the due date of the parent dependent on the nearest/shortest due date of their sub-tasks. For example:
Story --> due date is empty during creation
Sub-task 1 --> due date is 01.04.2021
Sub-task 2 --> due date is 06.04.2021
Sub-task 3 --> due date is 31.03.2021

The due date of the parent should also be 31.03.2021 automatically.

How to do that?

1 answer

1 vote
Hana Kučerová Community Leader Mar 31, 2021

Hi @Sharon Freij ,

welcome to the Atlassian Community!

First idea - what about to react on the change of sub-task's due date? Something like - everytime the due date of sub-task is changed, find the parent and compare the dates. If the parent's due date is greater then the sub-task's due date, change the due date in the parent...

Hello,

thanks for your answer!

This idea would already help me a lot, but 1 remark: in our way of working we can have multiple sub-tasks in a story. How do I know that the due date from the parent represents the earliest or the latest sub-task due date?

For example if one of my sub-task due dates changes, and its right in the middle (between earliest and latest date), my parent task should not change.

Hana Kučerová Community Leader Apr 02, 2021

Hi @Sharon Freij ,

how I imagine this functionality:

1) The main story is created, it's due date is empty

2) The first sub-task is created with due date 30. 4. 2021, there's no due date in parent, so the parent's due date is set to 30. 4. 2021

3) The second sub-task is created with due date 31. 3. 2021, this due date is compared to the parent's due date - it is earlier, so the parent's due date is set to 31. 3. 2021

4) The third sub-task is created with due date 31. 5. 2021, this due date is compared to the parent's due date - it is not earlier, the parent's due date remains 31. 3. 2021

5) The third sub-task is updated with due date 15. 3. 2021, this due date is compared to the parent's due date - it is earlier, so the parent's due date is set to 15. 3. 2021

6) and so on...

So, I believe, if you do the comparison every time the due date changes in one of the sub-tasks, this could work... But it will work only for new stories.

How many stories do you already have in your project?

Hi @Hana Kučerová 

Thanks for your reply. 

I already have a lot of stories in my project, but that's not a problem. I'm looking for a solution for new stories, so that's fine.

How do I compare the due date of the parent with the due date of the sub-task? And if it needs to be changed, how should my automation rule look like? 
Still struggling :) ...

Hana Kučerová Community Leader Apr 14, 2021

Hi @Sharon Freij ,

please try something like this:

When: Value changes for Due Date (for all issue operations)

IF: Issue Type equals Sub-task

For Parent:

- If: Issue matches JQL: duedate is EMPTY

- Then: Edit issue fields: copy Due Date from Trigger Issue

For Parent:

- If: Issue matches JQL: duedate is not EMPTY

- And: Compare two values: Checks if: {{triggerIssue.duedate.diff(issue.duedate).days}} is greater than 0

- Then: Edit issue fields: copy Due Date from Trigger Issue

Hi Hana,

Thank you for the above, one question I do have and apologies if this is a silly question, I am struggling to see how you map to the "Copy due date from trigger issue". Is this a smart value or pulled through from the "More options" section?

Hana Kučerová Community Leader Nov 23, 2021

Hi @Steven Lloyd ,

I'm sorry about the late answer.

1) Click on ... -> Click on Copy from...

copy1.png

2) Click on Copy Due date from Current issue -> Click on Current issue -> Select Trigger issue -> Save

copy2.png

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events