How to get the issues in hierarchy using a JQL

Ganeshkumar Meenakshisundaram October 28, 2024

We use Jira Data Center. I would like to get the list of child issues under a Theme.

We have 2 issues of Issue type Theme - say TH-1 andTH-2

Our hierarchy goes like Theme -> Initiative -> Epic

I would like to get the list of Initiatives and Epics that are child issues of TH-1 and TH-2. Is there a way I could get this using JQL?

Additional Info - We have Advanced Roadmaps and Script Runner

TIA

3 answers

1 accepted

2 votes
Answer accepted
Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2024

Hello @Ganeshkumar Meenakshisundaram Welcome to the community!

issue in childIssuesOf("TH-1") AND issuetype in (Initiative, Epic)

This should get the Initiatives linked to TH-1 and Epics linked to those Initiatives.

Hope this helps!

Ganeshkumar Meenakshisundaram October 28, 2024

This worked for me.

0 votes
generalconsultancyun
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 28, 2024

To get the list of child issues under a Theme in Jira Data Center, you can use JQL (Jira Query Language) with the `issueLink` function.

 

Here's a sample JQL query to get the child issues (Initiatives and Epics) under a specific Theme:

```

jql

issueLinkType = "Child" AND issueLinkDestinationType = Theme AND issueLinkDestination = TH-1

```

This query will return all issues that are children of the Theme TH-1.

 

To get the child issues for both Themes (TH-1 and TH-2), you can use the `OR` operator:

```

jql

issueLinkType = "Child" AND issueLinkDestinationType = Theme AND (issueLinkDestination = TH-1 OR issueLinkDestination = TH-2)

```

This will return all child issues under both Themes.

 

If you want to filter the results to only show Initiatives and Epics, you can add additional JQL clauses:

```

jql

issueLinkType = "Child" AND issueLinkDestinationType = Theme AND (issueLinkDestination = TH-1 OR issueLinkDestination = TH-2) AND issueType IN (Initiative, Epic)

```

This will return only the Initiatives and Epics that are child issues of the specified Themes.

 

Note that the `issueLinkType` and `issueLinkDestinationType` fields are available in Jira Data Center, but not in Jira Cloud.

 

With Advanced Roadmaps, you can also use the `parentEpic` and `parentInitiative` fields to query for child issues. For example:

```

jql

parentEpic = TH-1 OR parentInitiative = TH-1

```

This will return all child issues under the Epic or Initiative with the ID TH-1.

 

Script Runner can also be used to create custom scripts and queries to retrieve the desired data. However, JQL is usually the most straightforward way to achieve this.

 

Hope this helps! Let me know if you have further questions.

0 votes
Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2024

Hi @Ganeshkumar Meenakshisundaram 

 

With standard JQL query it is not possible to get what you want. You can try to use "order by" but still I'm not sure that you will get right order.

 

Regards,

Seba

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events