Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,409
Community Members
 
Community Events
176
Community Groups

Get Issues In Epic in Scripted Field

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

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

Comment

Log in or Sign up to comment