Forums

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

Jira Structure - JQL to display closed issues when their

Rafael Tognolo
Contributor
July 26, 2022

Hello,

I'm trying to create a Structure with 2 different sections.

1 - This section should show all issues that are currently open, or belong to an Epic or Task that is not fully closed (at least one child ticket is still open)

2 - This section should show only closed issues or Epics and Tasks that are fully closed (all child tickets are also closed)

Are you able to assist with this JQL?

Thank you

 

1 answer

1 vote
David Niro
Atlassian Partner
July 26, 2022

Hello @Rafael Tognolo ,

David from ALM Works here.

We should be able to figure something out.  To make sure we're on the same page to start, could you describe the hierarchy you are trying to build?  In other words, do you want

Epics
  Tasks
    Sub-Tasks
  Stories

Or something flat, like 

Epics
Tasks
Stories

Also, could an Epic or Task be closed but still have open "children"?  could an Epic or Task still be open even if all its "children" are closed?

Looking forward to your response.

Best Regards,
David 

Rafael Tognolo
Contributor
July 27, 2022

Hello @David Niro 

Thanks for the swift response.

The hierarchy is like this:

Epic
    Task
        Sub-task

And the answer is Yes to both: Also, could an Epic or Task be closed but still have open "children"?  could an Epic or Task still be open even if all its "children" are closed?

Even though this is not ideal, sometimes I come across these cases. Is there a way to prevent it?
For example, if all children's tickets are closed, then the epic is automatically closed. Or if one of children's tasks are open, the Epic cannot be closed?

Thanks

Like Dave Rosenlund _Trundl_ likes this
David Niro
Atlassian Partner
July 27, 2022

Hello @Rafael Tognolo ,

You are very welcome!  Thank you for the additional information!

I have an idea for this, but it is going to depend on which hosting method you are using (Cloud or On Prem). 

I noticed you tagged "unknown-hosting-type".  There's a very quick way to determine this.  

When you are in Structure, do you see a button for "Automation" or "Show Generators"?  If you see the former, you are "on prem" and the latter would indicate you are "cloud".

What I have in mind will work on prem, but won't yet (we're working on it) be available for cloud.

Best,
David

Like Rafael Tognolo likes this
Rafael Tognolo
Contributor
July 27, 2022

Hi David,

Ok, in this case, we're on the "on prem".

Thanks

Like # people like this
David Niro
Atlassian Partner
July 28, 2022

Hello @Rafael Tognolo ,

Perfect!  

You will want to add a Group Generator to your structure and select the Attribute option.  In the Group By list, select Formula.

use this formula:

WITH ALL_ISSUES =
COUNT#subtree{issuetype}
:

WITH DONE_ISSUES =
COUNT#Subtree{
IF(statuscategory = "DONE";1
)
}:

IF issuetype = "Epic" AND ALL_ISSUES = DONE_ISSUES:
"True Closed"
ELSE:
"Open"

Basically it compares the number of issues against the number of issues that are "done" and assigns text value "True Closed" to the Epic if the two values match and "Open" if they don't.

Please let me know if it helps!

Best,
David

Like Dave Rosenlund _Trundl_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events