You can now vote for scripts to help people know if they're useful or not. Login or create an account to vote!

1

Get a list of all the cloned issues in a project

Overview

A simple console script which can be used to get all the cloned issues in a specific project.

Example

As a user, I want to get a list of all the cloned issues in a project. To do this, I can run this sample script on ScriptRunner's console.

Requirements

  • Jira Jira (8.5 - 8.22)
  • ScriptRunner for Jira ScriptRunner for Jira (6.45.0)
    
import com.atlassian.jira.component.ComponentAccessor def issueLinkManager = ComponentAccessor.issueLinkManager def projectManager = ComponentAccessor.projectManager def issueManager = ComponentAccessor.issueManager //Specify the project key final def projectKey = '' def project = projectManager.getProjectByCurrentKey(projectKey) def issues = issueManager.getIssueObjects(issueManager.getIssueIdsForProject(project.id)) issues.collect { issueLinkManager.getOutwardLinks(it.id).findAll { it.issueLinkType.name == 'Cloners' }.collect { it.sourceObject.key } }.sort().flatten()
Discovered an issue? Report it here

Suggested for you