The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Fetch all child links of Feature Issue type

Jyoti Kumari
Contributor
March 28, 2025

Hello Everyone,

 

A 'feature' issue type named as 'A-123' issue is linked to 'epics' issues by 'Parent link' field, so one epic issue which is children of issue 'A-123' is now converted to task issue  type(B-567), so in issue from jira GUI  issue 'B-567' is not visible but from scripting code ,it is still returning as children.Kindly resolve how to fix these issue children should not return issue 'B-567'.Please find code snippet below-

 

-------------------------------------------------------
def getChildren(issueId, Logger logger, linkType,IssueLinkTypeManager issueLinkTypeManager,IssueLinkManager issueLinkManager) {
def childLinkTypes = issueLinkTypeManager.getIssueLinkTypesByName(linkType)
if (childLinkTypes) {
Long linktypeID = childLinkTypes[0].id
def linkedStories = issueLinkManager.getOutwardLinks(issueId).findAll { it.linkTypeId == linktypeID }*.destinationObject
return linkedStories
}

 

return null
}
--------------------------------------------------------------
call above method:-

children = getChildren(issue.id, logger, 'Parent-Child Link',issueLinkTypeManager,issueLinkManager,user,issueManager,issue)

 

Thanks and Regards,

Jyoti

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Trudy P Claspill
Community Champion
March 28, 2025

Hello @Jyoti Kumari 

I don't have an environment to test this, but this is my suggestion.

In the future if the Epic has child issues, remove those children before you change the Epic issue type. Then remove the Epic as a child of the feature. Then convert the Epic to the new issue type.

To fix the state you are in now, convert the issue back to an Epic. Then remove the Epic as a child of the feature. Then convert it again to a Task.

DEPLOYMENT TYPE
SERVER
VERSION
9.12.19
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events