Forums

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

Automatically close an epic in when all linked issues (from another project are closed)

Rosana Casilli
Contributor
August 26, 2023

Hi all!!

 

I am trying to achieve the following scenario.

I have a project A wich will have epics and some epics will have some child issues (same project of course) and some linked issues from project B,C, and D.

We need to close Epic in project A, when all child issues and linked issues from project B,C and D are closed. 

 

Can you help me to find out have to solve this?

 

Thanks in advance,

Ro

2 answers

1 accepted

1 vote
Answer accepted
Rosana Casilli
Contributor
August 31, 2023


Hi All!!!

 

After several days, I finally got what I needed using automation.

I have had to create some custom fields, and create not only one but three automation rules.

If anyone interest, here it is what I have done to recreate the possible scenarios:

 

Situation: We have a project A, where users creates epics an these epics could be:

1. Epic-> child issues

2. Epic-> linked issues from same project or other projects

3. Epic -> child issues 

           -> linked issues from same project or other projects

 

So, first of all, I need to know:

1. has the epic child issues?

2. has the epic linked issues?

3. if the epic has child. are all child issues closed?

4. if the epic has linked issues, are all linked issues closed?

Saying that, I created 4 custom fields, haschild, haslinked, childclosed, linkedclosed. All fields with default value set to NO

 

Now, first two automations:

 

On Project A, I created one automation, 

Trigger event: On create issue

Condition: if parent exists then haschild 

Branch: for epic parent set haschild to Yes

 

As a multiproject rule:

In rule details. select all the project that are going to be involved to project A

Trigger event: when issue linked

Branch: for  linked issues (all types), set haslinked to Yes

 

Last an more important rule

as a multiproject rule: close epic 

In rule details, select all the project that are going to be involved to project A

Trigger event: when issu transition to Done 

 

Branch: For epic (parent)

Condition: stories (or other issues in this epic) match jql Status = Done

then childclosed =Yes

if issue matches JQL : haschild, haslinked, childclosed, linkedclosed

(linkedclosed =Yes and haslinked= SI and childclosed= SI and haschild=SI) or (linkedclosed=SI and haslinked= SI and childclosed= NO and haschild=NO) or (linkedclosed=NO and haslinked= NO and childclosed= SI and haschild=SI) 

Then transition to done

 

Branch: for linked issues (all types)

Condition: all link types match Status =Done

Then linked linkedclosed = yes

if issue matches JQL : haschild, haslinked, childclosed, linkedclosed

(linkedclosed =Yes and haslinked= SI and childclosed= SI and haschild=SI) or (linkedclosed=SI and haslinked= SI and childclosed= NO and haschild=NO) or (linkedclosed=NO and haslinked= NO and childclosed= SI and haschild=SI) 

Then transition to done

 

So the scenarios that I have tested are:

 

actions.png

Hope this helps!

 

Ro

1 vote
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 26, 2023

Hi @Rosana Casilli,

Here is an example rule to get you started:

Rule example.png

Linked issues condition.png

The main part here is conditions to check issues in Epic and linked issues from the projects you specified. I used the trigger Scheduled for this rule, but feel free to play around with other triggers.

Sanjog Sigdel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 26, 2023

Hi @Kseniia Trushnikova 

I have also tried the same automation rule to close the Epic when all children issues are completed.

Rosana Casilli
Contributor
August 28, 2023

hi @Kseniia Trushnikova should I place it on global automation?

Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2023

@Rosana Casilli, nope, it will work as a single project rule.

Rosana Casilli
Contributor
August 28, 2023

Hi @Kseniia Trushnikova 

 

It is not working for me.

when I execute the rule i got a message on audit log:

 

Related issues condition:
The following issues did not match the condition:
ISMG-31,ISMG-23,ISMG-10,ISMG-11, ISMG-9, ISMG-32, ISMG-8, ISMG-7, ISMG-20, ISMG-24, ISMG-5, ISMG-6, ISMG-1, ISMG-4
This is the rule:
rule1.png rule2.png rule3.png rule4.png
Is there something that I am missing?
Thanks in advance
Ro
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2023

@Rosana Casilli, do issues not match the second condition? Let’s change the condition to None match specified JQL and change the JQL to:

project in (CK, CA) and status not in (Closed, Done)

Will it work?

Rosana Casilli
Contributor
August 28, 2023

Hi @Kseniia Trushnikova  

 

I changed to "none match" but still not transitioning the epic to None...

same audit log:

Action details:
["10157"]
Related issues condition
The following issues did not match the condition:
ISMG-31, ISMG-9, ISMG-23, ISMG-8, ISMG-10, ISMG-32, ISMG-7, ISMG-11, ISMG-24, ISMG-20, ISMG-5, ISMG-6, ISMG-1, ISMG-4

 

I think the audit log says "Related issues condition" but it is not referring to the condition in the autiomation, it is related to the sql for the schedule action, because I checked the issues returned in that JQL and are the same as I pasted above. 

 

Now, when I validate the "Matching JQL" for the second condition "project in (CK,CA) and Status in (Closed, Done)" it founds 0 issues

rule5.png

Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2023

@Rosana Casilli, add Log action after the trigger and conditions to investigate the issue. Something like that:

Log action.png

Are you sure there is an epic with all closed issues and all closed/done linked issues in the projects CK, CA? Maybe the problem is just related to this?

Rosana Casilli
Contributor
August 28, 2023

Hi I added the log action and only passed the trigger okay.. it only pass the trigger condition

On the firtst conditon (Stories or other issues) it shows that those issues do not match.

 

looking for information, we can't do this in a single rule project. It should be done in a global rule, specifying the project. So I tried to replicate this on a global rule but still not working.

 

Any other way to do it? maybe using JMWE?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, loom, AI, meeting recording, community

[NEW] Record your meetings with Loom

Welcome to great meetings, with less work. Automatically record, summarize, and share instant recaps of your meetings with Loom AI.

Learn more
AUG Leaders

Atlassian Community Events