Automation: Due date has to change for all stories of Epic if any story due date changes

Shivaprasad Hattaraki November 19, 2023

Hello,

I want to change the due date of all stories under epic if any of the story due date changes.

 

Scenario: I have Epic-1, Story-1, Story-2, Story-3, Story-4

If the Story-2 due date changes, automatically Story-1, Story-3 and Story-4 due date has to be updated with the Story-2 due date Plus 3 days.

But the Story-2 due date should not be updated with value plus 3 days.

 

1 answer

6 votes
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2023

Hi @Shivaprasad Hattaraki 

This should work:

  • Trigger: Field Value Changed
    • Field to Monitor = Due Date
  • Condition: Related Issues Condition
    • Related Issues = Parent
    • Condition = Exists
  • Branch: Related Issues
    • Type = JQL
    • JQL - parent = {{triggerissue.Parent}} AND key != {{triggerissue.key}}
      • Branch-Action: Edit Issue
        • Field = Due Date
          • Value = {{triggerissue.due date.plusDays(3)}}

---

A few notes on this rule...

  • This rule uses smart values, which work in JQL also
  • I've used Parent rather than Epic Link, which now works for Epics, as the Epic Link is being deprecated soon. This is more future proof
  • The JQL locates other issues in the Epic, and then exempts the Story which activated the rule

---

Some other information I'd consider for your logic:

  • If Story 2's due date changes, update Stories 1, 3 and 4?
  • I assume this is only for open Stories?
  • Is it always that all "other" Stories are updated or are their exemptions to this (eg. an issue is further down the workflow)?
  • Does this work both ways - i.e due date is earlier or later?

Additional information is good here as there's lots of avenues you could go down :)

---

Let us know what you think!

Ste

Shivaprasad Hattaraki November 21, 2023

Hello @Ste Wright ,

 

Thank you so much, It works well.

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 21, 2023

Awesome, glad it works for you!

If this answer helped, could you accept it?

Ste

Shivaprasad Hattaraki November 21, 2023

Hello @Ste Wright ,

 

I have one more requirement.

1. Story points = 3 and this increased to 5

2. Due date = 22/Nov/2023

The due date should be updated with the Due date of the current Story(22/Nov/2023) and the Story point increased(2).

3. Due date = 24/Nov/2023.

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2023

Hi @Shivaprasad Hattaraki 

The Story Points requirement is a little more complex.

You'd have to be careful with this rule, as a reduction in Story Points below 0 will still be entered via Automation - which Story Points does not allow manually. That could have abnormal impacts on your reports, etc.

I've added an IF/ELSE rule below to manage for that (using Branches).

---

The rule might look like this:

  • Trigger: Field Value Changed
    • Field to Monitor = Story Points
  • Condition: Related Issues Condition
    • Related Issues = Parent
    • Condition = Exists
  • Action: Create Variable
    • Name = StoryPoints
    • Value = {{#=}}{{changelog.Story Points.toString.asNumber}} - {{changelog.Story Points.fromString.asNumber}}{{/}} 
  • Branch: Related Issues
    • Type = JQL
    • JQL - parent = {{triggerissue.Parent}} AND key != {{triggerissue.key}}
      • Branch-Condition: Advanced Compare Condition
        • First Value = {{#=}}{{issue.Story Points}} + {{StoryPoints}}{{/}} 
        • Condition = greater than
        • Second Value = 0
      • Branch-Action: Edit Issue
        • Field = Story Points
          • Value = {{#=}}{{issue.Story Points}} + {{StoryPoints}}{{/}}
  • Branch: Related Issues
    • Type = JQL
    • JQL - parent = {{triggerissue.Parent}} AND key != {{triggerissue.key}}
      • Branch-Condition: Advanced Compare Condition
        • First Value = {{#=}}{{issue.Story Points}} + {{StoryPoints}}{{/}} 
        • Condition = less than
        • Second Value = 0
      • Branch-Action: Edit Issue
        • Field = Story Points
          • Value = <leave blank>

---

A few notes...

  • The "Create Variable" action calculates the difference between what the Story Points field was, and what it is now
  • This is then used in the first Branch-Action, to add the difference to the other Stories under the Epic
  • The two separate Branches use a Condition to ensure Story Points will be above 0 - if not, the second Branch moves Story Points to empty (i.e 0)

I've just included Story Points above as an example, you can combine the two rule parameters together as required - eg.

  • Have the trigger monitor for both Due Date and Story Points
  • Add in the 2 different field modifications into the relevant Action

---

Let us know if this works for you :)

Ste

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events