JQL to List Pending EPIC with their User stories and subtasks

SuperScrummer February 11, 2020


Is there a JQL with which we are able to find the list of Pending Epics with their stories and subtasks.

Please let me know whether it can be achieved without any addon. 

If needed addon, which one will support this scenario.



1 answer

0 votes
Seb Sidbury February 12, 2020


I think you'd need an add-on to write those subqueries.

Enhanced Search or ScriptRunner offer issuesInEpics() which you could use to return all the stories in Pending epics:

 issueFunction in issuesInEpics("status="Pending"")

You could then save that query as a filter, which you can use as the input for subtasksOf() to return the subtasks of these stories:

 issueFunction in subtasksOf("filter = "Issues in Pending Epics"")

Hope that helps.

Seb (Adaptavist)

Ryan Rules [Adaptavist] February 12, 2020

Hi SuperScrummer,

Further to Seb's comment above, we confirmed this can be achieved by combining queries. For example:

Firstly, within ScriptRunner or Enhanced Search you can get the Stories of incomplete Epics with the following JQL:

issueFunction in issuesInEpics("project = DEMO AND status != Done") AND issuetype = Story

 ...and save this as a Enhanced Search Filter e.g. as "Stories of incomplete Epics"

Then you can use the above filter in a new JQL query such as:

project = DEMO AND issuetype = Epic AND status != Done OR filter in ("Stories of incomplete Epics") OR issueFunction in subtasksOf("filter in ("Stories of incomplete Epics")") ORDER BY issuetype

...which will return:

  • Any Epics where is the status is NOT "Done" in a given project
    • The stories within such Epics
      • The Sub-tasks within such stories
  • Ordered nicely by issuetype


Hope that helps!

Many thanks,

Ryan Rules (Adaptavist)

Suggest an answer

Log in or Sign up to answer