A common reporting request is a single table that lists an Epic together with all of its Stories, rather than two separate lists that have to be cross-referenced by hand. JQL alone cannot express “this issue, plus everything linked to it” – but the jqlxFlattenedTwoLevelTree function from CelesteCS JQL Extensions does exactly that.

The query

  • issue in jqlxFlattenedTwoLevelTree("project = APP and type = Epic and status != Done")

This returns every open Epic in the project and every issue directly linked to those Epics (their Stories, in a typical Jira setup), combined into one flat list with no duplicates – even though the JQL query itself only asked for Epics.

Narrowing it to a specific link type

If the instance has several link types and only the Epic-Story relationship should be flattened, pass it explicitly:

  • issue in jqlxFlattenedTwoLevelTree("project = APP and type = Epic and status != Done", "is Epic of", "Outward")

Turning the flat list into a table

Feed that same JQL query into a CelesteCS Reporting Jira Data Provider macro, and a Reporting Table View underneath it. Inside the Reporting Table Item body, a formula such as IF(CurrentItem.fields.issuetype.name = "Epic", "", REPT(CHAR(160), 4)) & CurrentItem.key indents Stories under their Epic visually, giving a genuinely hierarchical-looking report built from a single flat data source – no separate query per Epic required.

For a deeper look at building multi-level trees with actual parent-item references rather than indentation, see Building a multi-level Jira issue tree with Reporting List View.

Try it in your own Confluence: CelesteCS JQL Extensions for Jira on the Atlassian Marketplace – free trial for Data Center. This example also uses CelesteCS Reporting for Confluence.

JQL Extensions saves you time? A review on the Marketplace helps other teams find it.