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
Community Members
Community Events
Community Groups

Get the parent ID of a clone issue



I am trying to create a scripted field to show the parent ID of a clone issue.


This is my current code:

import com.atlassian.jira.issue.Issue

def issue = issue as Issue
def issueLinkManager = ComponentAccessor.getIssueLinkManager()

def baseLink = issueLinkManager.getIssueLinks( { issueLink -> == "Cloners Inward Link" }

if (baseLink) {
def linkedIssue = baseLink.destinationObject
def sourceID = linkedIssue.getKey()

return sourceID

return null


Any idea?


Thanks in advance!

1 answer

Hi again,

Solved with my following code:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

List <IssueLink> allOutIssueLink = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId());

for (Iterator <IssueLink> outIterator = allOutIssueLink.iterator(); outIterator.hasNext();) {
IssueLink issueLink = (IssueLink);
String linkType = issueLink.getIssueLinkType().getName();
if (linkType == "Cloners"){
String key = issueLink.getDestinationObject().getKey();
return key


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

179 views 1 6
Read article

Atlassian Community Events