How to automatically set the issue due date based on subtask due dates?
Asked by Taneli Ylinen:

Hi everyone, I am a real newbie to Jira and have been trying to solve this for last 24hours without finding an solution. So under the issues there are few subtasks that have set due dates and I would want Jira Automation to automatically update the issues due date based on the latest subtask due date. So automation would compare sub task due dates and would choose the latest due date and set it to issue duedate.

How can I do this? I have tried tens of combinations but have not succeeded to automatically update the issue duedate (that currently is always empty for all issues as I am only following subtask due dates)

Can someone help me? Like said, I started using Jira 3 days ago so an not familiar with most of the functions it has

![oneofmytests.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/155344i10316DD30FEC4822/image-size/large?v=v2&px=999 "oneofmytests.jpg")


Answers:
author: Piotr Zadro?ny _Eyzee_
body: Hi [@Taneli Ylinen](/t5/user/viewprofilepage/user-id/4508520)

The rule that works in my demo is:

![ALL.png](https://community.atlassian.com/t5/image/serverpage/image-id/155359iFEF4A6F07B03E6F5/image-size/large?v=v2&px=999 "ALL.png")

1. When: Field value changed. **Fields to monitor for changes** : **Due date** for **All issue operations**
2. Condition: Field **Issue type** **equals** value **Sub-task**
3. Condition If block: Field **Due date is after** Field **Due Date from the Parent issue**
4. Branch rule: Type of related issues **Parent**
5. Action: Edit issue, copy **Due date from Trigger issue**
6. Else block
7. Branch rule: Type of related issues **Parent**
8. Condition Issue field condition: Field **Due date is empty**
9. Action: Edit issue, copy **Due date from Trigger issue**

If you need any screen from any step please let me know

*I used if else statement because without else (checking if Due Date of parent is empty) statement automation rule does not worked when parennt issue does not have Due date field already set.*

Best regards,

Piotr

comments: author: Taneli Ylinen
body: Thanks Piotr, That setup went through and is now enabled, but however nothing changes on the project? I mean if I modify the sub-task dates, the issue date still remain empty no matter what I do? Am I missing something that would need to be enabled or set to make the automation work? Even the stock automations like "when all subtasks are done -\> move parent to done does not take effect when I try.![jiraautomation.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/155360i62814B9166F212A8/image-size/large?v=v2&px=999 "jiraautomation.jpg")


author: Taneli Ylinen
body: Hi, I took a look at the automation logs and from those it seems that the automation should be working, but it will still not change the due date of the issue? It just remain blank always

![jiraautomationsuccess.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/155402iDAFB59F8BE89C63F/image-size/large?v=v2&px=999 "jiraautomationsuccess.jpg")


author: Erin Quick-Laughlin
body: Just a few thoughts [@Taneli Ylinen](/t5/user/viewprofilepage/user-id/4508520)

1. Are the Due Date fields the same type of field in parent \& child?

2. I'm not sure if it's possible to block the JA user, but if it is, are there special permission or security scheme restrictions on parent issue type?

3. Have you tried adding a logging statement to your JA, to see what value is being picked up from the child?


author: Tijs Tijert
body: I am running ionto the same issues as [@Taneli Ylinen](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4508520).  
The rule has been made.... the rule seems to execute according to the rule executions overview in the issue, but the value of the related issue doesn't actually change.  

I created a rule for blocked issues, so when an issue can not start before another issue is completed.

If the first issue has a new Due date, I want to copy that new due date to the start date of the blocked issue.

Attached are 2 screenshots. The first is of the rule, the second is of the first issue, where you can see that rules were executed.

It would be great to get some pointers![rule-view.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/161525iE63FB2FCF7C70B14/image-size/large?v=v2&px=999 "rule-view.jpg")![Issue-view.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/161526i9169A7FA2D96706F/image-size/large?v=v2&px=999 "Issue-view.jpg")


author: Ryan Hamilton
body: This solution worked for me.


author: Piotr Zadro?ny _Eyzee_
body: Hi,

Please provide some more info/screenshots that will help us troubleshoot your problem:

1. Click on TestiDueDate1 rule and then **Rule Details** - verify who is set as Actor. Is it **Automation for Jira** or any other user?
2. In Project Settings click Permission and write down all Users/Groups/Roles selected for permisions: Browser projects, Edit issues, Schedule issues. The user specified as Actor in step 1 should have thjose permissions (if its Automation for Jira there should be added Project role atlassian-addons-project-access)
3. Make sure you use build-in field Due Date on all screens (both task and subtask) and not some Custom Fields called Due Date
4. Do you use Issue Security Scheme (you can check it in Project Settings -\> Summary -\> Permissions -\> Issues - if you dont use any you should find there **Issues: none**)
5. Do you use Jira Cloud or Server/DC? (I assumed Cloud)
6. It would be also great if you could make a screenshot on every step in your automation rule 1 to 9
7. Before every action and branch step you can add another action **Log action and** in log message provide **{{issue.duedate}}** which will log in Audit log what was current duedate in an issue. You can then verify Audit log after the test rule execution by clicking the rule and then **Audit log**

Best regards,

Piotr

comments: author: Tijs Tijert
body: There is no Project role atlassian-addons-project-access in my project.  
How do I add it?


author: Tijs Tijert
body: Solved


author: Ahmed Nassar
body: Ok, I think this is just much better :D  

![Screenshot 2023-02-14 124511.png](https://community.atlassian.com/t5/image/serverpage/image-id/239976i23A1AC3D17C2B050/image-size/large?v=v2&px=999 "Screenshot 2023-02-14 124511.png")


author: Ahmed Nassar
body: This worked for me.![Screenshot 2023-02-13 153721.png](https://community.atlassian.com/t5/image/serverpage/image-id/239776i5FE392CF20F1C619/image-size/large?v=v2&px=999 "Screenshot 2023-02-13 153721.png")


Tags: atl-gruland