Forums

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

How to get the linked ticket details in JIRA

Rahul_MG June 19, 2020

Hi All,

I would like to know how to fetch the linked ticket details. Below is the code i am using,

public class IssueCheckPointsConfiguration extends AbstractJiraContextProvider {


@Override
public Map<String, Object> getContextMap(ApplicationUser applicationUser, JiraHelper jiraHelper) {

Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
String currentIssueType = currentIssue.getIssueType().getName();

}

I would like to know if there is any option to get the linked ticket details from the Issue class. 

Is there any way i can get the details from the database, by accessing data from some table.If so please share the table name. I could only identify "jiraissue" table which contains the issue details, but the linked issue details i am not able to get.

 

Please help.

 

1 answer

1 accepted

1 vote
Answer accepted
CJ Edwards
Contributor
June 19, 2020

HI Rahul

What is your goal? What 'details' are you looking for in a linked issue?

You can use something along these lines to run through inward or outward linked issues

import com.atlassian.jira.component.ComponentAccessor

def linkManager = ComponentAccessor.issueLinkManager

def linksListOut = linkManager.getOutwardLinks(issue.id)
def linksListIn = linkManager.getInwardLinks(issue.id)

linksListOut.each { currentLink ->
Issue destination = currentLink.getDestinationObject()
//do something with/to destination Issue
}
Rahul_MG June 23, 2020

@CJ Edwards Thanks for the response this was what i was expecting.

Suggest an answer

Log in or Sign up to answer