How to get Epics where all Stories are done

AndréW March 12, 2019

Hello,

i need a query to get all epics having all linked stories done. I need it to correct the status of an epic if it is not done. In the same maner i have to get all stories, where the sub-tasks are allready done to set the status for such stories to the correct value.

I use the script runner add on. In SQL i could use the "not exists" clause to solve my problem. Maybe someone has an idea to how to solve it with jql.

Thanks.

3 answers

1 vote
AndréW March 12, 2019

For all with the same problem here are the working queries:

issuetype = epic AND issueFunction in linkedIssuesOf("status = Done", "has epic") AND NOT issueFunction in linkedIssuesOf("status != Done", "has epic") AND status != Closed

issuetype = story AND issueFunction in parentsof("status = done") AND NOT issueFunction in parentsof("status != done") AND status != done

Have a nice day.

Ansar Thennaden August 30, 2022

Thanks a lot Andrew

Karla Bernal September 7, 2022

hi, for that query in the "has epic" part... if I need to write has Feature Epic what would be the instruction? because I tried "has 'Feature Epic' ", "has [Feature Epic]", "has "Feature Epic" ", "has (Feature Epic)"... and nothing worked

0 votes
Merle Fischer
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.
March 12, 2019
AndréW March 12, 2019

Thank you @Merle Fischer

the solution in the linked page works for me.

Bye.

0 votes
Pedro Felgueiras
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.
March 12, 2019

Hy @AndréW 

 

You can try something like these 

issuetype = Epic and issueFunction not in linkedIssuesOf("resolution is Empty and issuetype = Story")

 

Best regards, 

Pedro Felgueiras

AndréW March 12, 2019

Hi Pedro,

your suggestion doesn't work for me. I can use resolution is not empty or issuecategory = done, in all these cases i get epics that have stories which are done and not done. I only want to get epics where all stories are done.

Best regards from Germany.

Suggest an answer

Log in or Sign up to answer