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: 

Get Issues In Epic in Scripted Field

Paul Tiseo
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 7, 2018

Using ScriptRunner for JIRA (Server), I want to create a custom field (HTML) that shows the ID and Summary fields of the child issues in the epic. How would I get that list of data using JIRA's API?

1 comment

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

Post a new discussion

Paul Tiseo
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 7, 2018

Ended up solving it myself:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.link.IssueLinkTypeManager

IssueLinkTypeManager issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)
IssueLinkManager issueLinkManager = ComponentAccessor.issueLinkManager

def sb = new StringBuilder()

def linkType = issueLinkTypeManager.getIssueLinkTypes(false).find{ it.name == 'Epic-Story Link' }
def issueLinkList = issueLinkManager.getOutwardLinks(issue.id).findAll{ it.getLinkTypeId() == linkType.getId() }
for (issueLink in issueLinkList) {
def childIssue = issueLink.getDestinationObject()
sb <<= '<a href=\'https://projects.jtafla.com/browse/'
sb <<= childIssue.getKey()
sb <<= '\'>'
sb <<= childIssue.getKey()
sb <<= '</a> ('
sb <<= childIssue.getSummary()
sb <<= '), '
}
return sb
Like # people like this
TAGS
AUG Leaders

Atlassian Community Events