Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

In which table does a Parent ID of an Sub-task stored in?

Anudeep Gudipelli April 15, 2025

Hi All, 

I am looking for a database table relation/information for parent id of an sub-task, I would like to build a query to get the parent id(jira issue number) which is associated to the sub-task. 

1 answer

0 votes
Matt Doar (Adaptavist)
Community Champion
April 15, 2025

I think it is in the issuelink with the linktype of either subtask or Parent/Child. The source and destination are the issue ids of the parent and child (subtask) issue. Sorry for the lousy formatting but the bestway to confirm this is to play about with a test DB and Jira

mysql> desc issuelink;

+-------------+---------------+------+-----+---------+-------+

| Field       | Type          | Null | Key | Default | Extra |

+-------------+---------------+------+-----+---------+-------+

| ID          | decimal(18,0) | NO   | PRI | NULL    |       |

| LINKTYPE    | decimal(18,0) | YES  | MUL | NULL    |       |

| SOURCE      | decimal(18,0) | YES  | MUL | NULL    |       |

| DESTINATION | decimal(18,0) | YES  | MUL | NULL    |       |

| SEQUENCE    | decimal(18,0) | YES  |     | NULL    |       |

+-------------+---------------+------+-----+---------+-------+

5 rows in set (0.01 sec)

 

mysql> select * from issuelinktype;

+-------+-------------------+---------------------+----------------------+------------------------+----------+

| ID    | LINKNAME          | INWARD              | OUTWARD              | pstyle                 | POSITION |

+-------+-------------------+---------------------+----------------------+------------------------+----------+

| 10000 | Blocks            | is blocked by       | blocks               | NULL                   |        1 |

| 10001 | Cloners           | is cloned by        | clones               | NULL                   |        2 |

| 10002 | Duplicate         | is duplicated by    | duplicates           | NULL                   |        3 |

| 10003 | Relates           | relates to          | relates to           | NULL                   |        4 |

| 10100 | jira_subtask_link | jira_subtask_inward | jira_subtask_outward | jira_subtask           |     NULL |

| 10200 | Epic-Story Link   | has Epic            | is Epic of           | jira_gh_epic_story     |     NULL |

| 10201 | Parent-Child Link | is child of         | is parent of         | jira_jpos_parent_child |     NULL |

+-------+-------------------+---------------------+----------------------+------------------------+----------+

7 rows in set (0.01 sec)

Matt Doar (Adaptavist)
Community Champion
April 15, 2025

This is Jira 10.6

Anudeep Gudipelli April 18, 2025

Hi Matt, 

Thank you for your response, I am trying to get the parent issue number from a sql query. 

Here is the thing, when I export issues from the JQL filter, under Parent ID column I get an ID which is a Jira issue, I need to query in the DB to get the Jira Issue Number such as ABC-123

ABC-123 is the parent task of ABC-128.

ABC-128 is the jira sub-task issuetype

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.8
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events