It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I automatically set the due date of a parent issue to the maximum due date among all sub tasks?

Andreas Knecht Community Leader Nov 24, 2016

Whenever a sub-task's due date is edited, I'd like to update the parent's due date if the sub-task's due date is later then the current due date of the parent (and all other sub-tasks).

1 answer

1 accepted

2 votes
Answer accepted
Andreas Knecht Community Leader Nov 24, 2016
So this automation rule is a bit crazy, but it is *actually* possible to do this.  Here's a screenshot of the rule in action:
set-due-date-tomax.png
Let me break this down:
  • First we have an issue updated trigger
  • Next we have a condition to check that the issue's duedate was updated by checking that {{#changelog.duedate}}{{toString}}{{/changelog.duedate}} is not empty
  • Next we run a JQL condition to check it was a sub-task we edited
  • And then we have a related issues condition that checks all other sub-tasks and parent (excluding the current issue) to see if they all have due dates before the current issue.  So first we lookup siblings and parent using: parent = {{issue.parent.key}} and key != {{issue.key}} OR key = {{issue.parent.key}}
    Then we check that all of them match: duedate is empty OR duedate < '{{#issue.fields.duedate}}format="jqlDate"{{/issue.fields.duedate}}'
  • If that's true, then we edit the parent issue and set its duedate to the due date of the issue that triggered the rule chain using this advanced JSON:

    {
       "fields": {
         "duedate":"{{#triggerIssue.fields.duedate}}format=\"jiraDate\"{{/triggerIssue.fields.duedate}}"
       }
    }

 

Here's a screenshot of just the related issues condition as well:
related-condition.png
This is a pretty advanced use-case for Automation for JIRA and not quite as simple as we'd like it to be yet!  
marcelo@zulimar.ca Oct 02, 2018

Does it work also for epics when one of its stories has the due date changed?

 

Like this:

This is an epic that has its due date set to 10/24

dueDate_dynamic.PNG

BUT inside of it there is a story whose the due date is 10/25.dueDate_dynamic01.PNG

 

Can you confirm? Thanks in advance

Best

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

2,168 views 6 15
Read article

Community Events

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

Events near you