How to get a list of subtasks associated with a ticket? (sql query)


I am trying to build a sql query where I can find subtask with associated jira bug. There can be multiple subtasks with different types of subtasks . Can someone please recommend appropriate pointers.


3 answers

WIll this JQL work for you ? I am running on Jira 5.0.4.

issuetype = sub-task and parent = <issue identifier>

It will display all the subtasks associated with the Jira <issue identifier>

Thanks Norman for response, I am working on sql query in order to filet further by other parameters.

The relationship between subtasks and parents are stored in the issuelink table. This table contains all the issue links, including blockers, duplicates, related issues, etc. For each entry in the issuelink table, you can tell what type of link it represents by looking at the LINKTYPE field.

The LINKTYPE field will contain a numeric ID. That ID is a key of the issuelinktype field. Since you’re interested in subtasks, you’ll be interested in the issuelinktype whose LINKNAME is “jira_subtask_link”.

That should be enough to get you started.


Thanks for response, I am still working on the query :(

You seem to be asking many questions about making SQL queries against the Jira database. If you haven’t seen the documentation for Jira’s database schema yet, you can find it at

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,175 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot