Missed Team ’24? Catch up on announcements here.

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

Getting Issue Links Reliably Via Server API

Paul Tiseo November 16, 2018

I have two tickets I use for testing my code below. One (ITSD-94) is an epic with 2 story links. The other (ITSD-1062) is an epic with a "Child-Parent" link, which is a custom link we created.

With getLinkCollectionOverrideSecurity().getAllIssues(), I get no issues from ITSD-94, but do get the one issue under ITSD-1062.

Why?

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

def issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject('ITSD-94')
//def issue = issueManager.getIssueObject('ITSD-1062')

def issueLinkList = issueLinkManager.getLinkCollectionOverrideSecurity(issue).getAllIssues()
for (def issueLink: issueLinkList) {
log.error 'issue link2: ' + issueLink//.getKey()
}

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2018

Hi @Paul Tiseo

The issue link manager will return items that have been created by issue linking.

the relationship between stories and the epic you set on them is not an issue link

you will need to write code to access epic stories specifically 

TAGS
AUG Leaders

Atlassian Community Events