Skip to main content
Example scripts
arrow icon
To homepage
Jira
Cloud icon
Cloud

Clone an Issue and Link To It

Created 1 year ago, Updated 10 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira
Language |
groovy
def issueKey = 'IssueKeyHere'

def sourceIssue = Issues.getByKey(issueKey)

def project = sourceIssue.getProjectObject()

def issueType = sourceIssue.getIssueType()

def clonedIssue = Issues.create(project.key, issueType.name) {
    summary = sourceIssue.summary
    description = sourceIssue.description
}

// Change link type name below if you do not want to use the clones link type
clonedIssue.link("clones", sourceIssue)
Having an issue with this script?
Report it here