How to find all the child issues for a given parent ?

SantanuG January 13, 2020

Sample_Issue_Types_Returned.pngI am using the below REST URL to get issue details

https://jira2.xxx.com/rest/api/2/issue/SOARCLIN-35858?fields=*all

I am getting most of the issuelinks execpt "is a parent of" and "is a child of" . Other issuelinks are returned by server like

  1. "is blocked by"
  2. "was introduced by"
  3. "is a patch of"

This SOARCLIN-35858 ( JIRA Key)  has a child issue linked with it and it's showing in JIRA user interface but while I am hitting the REST URL , it's not giving me the "is a parent of" and "is a child of" linked issues.

What I need to do to get parent/child linked issue ?

Please find the attachment for better visualization. JIRAISSUE.png

1 answer

1 accepted

1 vote
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 15, 2020

Hi,

I understand that you are looking to find all the child or parent issues of a given issue in Jira.  However the way that your Jira site appears to be showing this relationship is rather different than what I expected here. 

Jira natively has the ability to create subtasks.  These are child issues to a parent.  They don't exactly appear in the issue links, instead they have their own section on the parent issue page.  In your case, it looks like either some person or some plugin in Jira has created these issue link types of 'is a parent of' and 'is a child of'.

I would be interested to first learn if these issue link types are defined in the admin panel of Jira.  If you are a system admin in Jira you can go to /secure/admin/ViewLinkTypes!default.jspa to see a list of all the link types in Jira.   Alternatively, a REST API get call to GET /rest/api/2/issueLinkType could tell us all the issuelinktypes as well.

If we don't see the linktype in either of those locations, then perhaps you have some plugin in Jira that is making this linkage in another manner and just displaying it here, but I'm not sure what plugin would do that.

Alternatively, you could use the linkedIssues() function to find all the issues with a specific linktype to that issue. 

In a case link yours you could use a JQL syntax of:

issue in issuelink("SOARCLIN-35858","is a parent of")

Which in turn should return all the issues that link to that specific issue with that directional link type.  You can make these kinds of JQL searches via the REST API endpoint GET /rest/api/2/search.

Try this out and let me know the results.

Cheers,

Andy

SantanuG January 16, 2020

Hi Andy,

Thanks a lot for your help. It worked !!!!

Now I am using

https://jira.xxx.com/rest/api/2/search?jql=issuekey in parentIssuesOf("SOARCLIN-36003") and which is returning the parent child relationship.

Cheers,

Santanu

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events