Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Field update to parent of Epic

James Wardle
Contributor
October 14, 2022

We have an issue type hierarchy of Capability > Epic > Story.

When all Epics under the Capability have a field set to True, I'd like that to update the same field in the Capability.

However, I can't work out how to do that with an automation rule? I can't seem to set it to recognise that the parent is Capability, and needs to be updated by a change to a field in all the Epics.

"ABC" in the attached screenshot is the name of the field. 

Screenshot 2022-10-14 at 14.15.31.png

1 answer

1 accepted

1 vote
Answer accepted
Mark Segall
Community Champion
October 14, 2022

Hi @James Wardle - The Parent branch is misleading as it does not pertain to Advanced Roadmap hierarchy.  You'll want to do this:

  • TRIGGER: Field Value Changed (ABC)
  • BRANCH (JQL)
    • Key = {{issue.Parent Link}}
    • ACTION: Edit Issue (ABC)
James Wardle
Contributor
October 14, 2022

Thanks @Mark SegallThat makes sense.

Do you know how I would set it so the Capability was only updated when all Epics have True in the ABC field? 

Mark Segall
Community Champion
October 14, 2022

You could try this:

  • TRIGGER: Field Value Changed (ABC)
  • BRANCH (JQL)
    • Key = {{issue.Parent Link}}
    • ACTION: Lookup Issues
      • "Parent Link" = {{issue}} AND ABC = False
    • CONDITION (Advanced)
      • {{lookupIssues.size}}
        Equals
        0
    • ACTION: Edit Issue (ABC)
James Wardle
Contributor
October 17, 2022

Thanks @Mark Segall - this worked! Thanks for suggesting this, I don't think I'd have got there otherwise.

Like Mark Segall likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2022

Hi @James Wardle 

Yes, and...to Mark's answer:

When checking a lookup issues result for no issues, it helps to use a default value to compare.  Otherwise the result will be "null" and that may not match to 0 logically.  For example, testing with:

  • first value: {{lookupIssues.size|0}}
  • condition: equals
  • second value: 0

Kind regards,
Bill

Like Mark Segall likes this
Mark Segall
Community Champion
October 17, 2022

I think I learn at least one thing new from @Bill Sheboy each week.  Otherwise, my week is a failure.  😉

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2022

Ha, and thanks.  You are on a roll answering questions, Mark.  Well done!

James Wardle
Contributor
November 4, 2022

@Mark Segall @Bill Sheboy So I now have a slightly more complex scenario that I think you guys might be able to help with (but related to the above). I've tried to implement the below, and I've got myself confused/can't get it to work. 

The issue type hierarchy is Sub-task > Story/Task > Epic > Capability.

The field that gets updated has multiple values - 1, 2, 3, 4, 5 (for simplicity). They're environments that we deploy to, so in theory we can roll back at points. 

We want to roll up when all child items have the same value for a field e.g. when all sub-tasks have the ABC field set to 1, then the parent Story/Task gets that field set to 1. Same method for Story/Task to Epic, Epic to Capability. 

For Story/Task rolling up ABC field of 1 or 2 to Epic I've gone for: 

  • TRIGGER: Field Value Changed (ABC)
  • CONDITION: if all match - ABC = 1 AND issuetype in (Story, Task)
    • BRANCH (JQL)
      • Key = {{issue.Epic Link}}
      • ACTION: Lookup Issues
        • "Epic Link" = {{issue}} AND ABC in (2, 3, 4, 5)
      • CONDITION (Advanced)
        • {{lookupIssues.size|0}}
          Equals
          0
      • ACTION: Edit Issue (ABC)
        • ABC = 1
  • CONDITION: if all match - ABC = 2 AND issuetype in (Story, Task)
    • BRANCH (JQL)
      • Key = {{issue.Epic Link}}
      • ACTION: Lookup Issues
        • "Epic Link" = {{issue}} AND ABC in (1, 3, 4, 5)
      • CONDITION (Advanced)
        • {{lookupIssues.size|0}}
          Equals
          0
      • ACTION: Edit Issue (ABC)
        • ABC = 2

 

However, if I have two stories, and the first one gets set to ABC = 1, then that updates the Epic to also be ABC = 1. I need it to be both stories (in this instance).

I might have over complicated the rule, but wondered if you could help please?

Mark Segall
Community Champion
November 4, 2022

Hi @James Wardle - So to confirm my understanding, you're trying to cover two possible scenarios:

  • ABC IN (2,3,4,5)
  • ABC IN (1,3,4,5)

If I'm correct, the challenge with this is that 3,4,5 match both outcomes so you'd need to come up with something that makes these unique.

Here's a possible route, but I'm not familiar with your data... Each issue must have either 2 or 1 selected and any combo of 3,4,5:

  • ABC IN (2) AND ABC IN (3,4,5)
  • ABC IN (1) AND ABC IN (3,4,5)

Not sure if this is an exact resolution for the problem you're facing, but hopefully it provides context into why it won't work as you currently have it.

James Wardle
Contributor
November 15, 2022

Hi @Mark Segall - thanks for getting back to me on this. It didn't nail the answer, but it definitely nudged me in the right direction to get to where I wanted to be.

I appreciate the help!

Like Mark Segall likes this

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