Forums

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

Child issues amount check

Tiago Pereira
Contributor
July 26, 2023

Hello

I would like to create a sort of an conditional that would only allow the Epic parent ticket to be closed, if at least x amount of child issues were created.

So basically in this case an check of the amount of child issues created.

 

Best Regards

 

Tiago A.

1 answer

0 votes
Ste Wright
Community Champion
July 30, 2023 edited

Hi @Tiago Pereira 

Not natively. There might be an App which can help with this - see the Marketplace - but I also found a workaround using a custom field, an automation rule, and a workflow condition.

This workaround will:

  • Create a field to store the count of child issues under an Epic
  • Automate the population of this field as required
  • Add a condition to the Workflow which can be used to "block" closures unless the child count is over a certain number

---

Custom Field:

  • Create a custom number field - for example, "Epic Child Count"
  • You can keep this field off the screen, or put it on a view-only screen (via Screen Scheme issue operations) for the Epic

---

Automation Rule:

This rule populates the field automatically, based on the number of child issues.

You do need to use "Multiple Issue Events" as the trigger, as Epic Link is not available in the trigger "Field Value Changed" - so it will trigger a lot. But the "Advanced Compare Condition" stops unnecessary actions taking place.

You might also need to run this rule once using a "Scheduled" trigger (which you can run manually once published), to populate the existing Epics with the field data.

  • Trigger: Multiple Issue Events
    • Events = Issue Created, Issue Updated
  • Condition: Related Issues Condition
    • Related Issues = Epic
    • Condition = Exists
  • Condition: Advanced Compare Condition
    • First Value = {{#changelog.epic link}}{{toString}}{{/}}
    • Condition = does not equal
    • Second Value = <leave empty>
  • Branch: Related Issues
    • Type = Epic (parent)
      • Branch-Action: Lookup Issues
        • JQL - "Epic Link" = {{issue.key}}
      • Branch-Action: Edit Issue
        • Field = Epic Child Count
          • Value = {{lookupIssues.size}}

---

Workflow Condition:

Finally, we need to set a condition which is based on the "Epic Child Count" field.

  • Edit the Workflow, and select Conditions for the "Done" transition
  • Add the Condition "Compare Number Custom Field"
    • Field = Epic Child Count
    • Condition = is greater than
    • Value = <number here>
  • Create the condition, then publish the workflow.

---

Notes:

  • The Automation Rule only works if an Epic Link is added, not removed - which means the "Epic Child Count" field only counts upwards, not downwards
  • If a reduction is count is needed, you could...
    • Create an additional custom field for the child-level - Epic Parent Key
    • Have a second Automation Rule populate it if an Epic Link is added
    • Have a third Automation Rule which has the "Advanced Compare Condition" based on the fromString, and utilises the "Epic Parent Key" to update the Epic once the Epic Link has been removed (and clear the Parent Key field)
  • ...but it does get quite complicated

---

Let us know if this works!

Ste

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events