cloneIssue

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

The availability of the users personal data may be impacted by the recent changes by Atlassian in order to meet GDPR compliance. See the following for more information:


Availability

  • This routine is available starting with katl-commons 1.0.
  • This routine is available for Jira server and cloud deployment options

Syntax

cloneIssue(issueKey, [issueLinkTypeName [, newParentKey]])

Description

Duplicates the issue and returns the key of the duplicated issue. If specified, it also creates a link to the duplicated issue.

Starting with katl-commons version 2.5.15 / 2.6.7 it accepts a 3rd parameter. However beware that using this parameter you can create subtasks in certain other projects and create infinite subtasks. This may render Jira unusable. Make sure the parent and the subtask will be in the same project. Make sure you do not create a subtask with another subtask as parent.

Cloud description

Duplicates the issue and returns the key of the duplicated issue. If specified, it also creates a link to the duplicated issue. Also, if the newParentKey parameter is specified it tries to create the subtask clone (it has to be a subtask) and assign it to the new parent issue.

In the cloud version an error is returned if there is a newParentKey and the issue identified by the issuekey is not a subtask.

Parameters

Parameter name

Type

Required

Description

issuekey

string

Yes

Key of the issue that has to be cloned.

issueLinkTypeName

string

No

Link to the duplicated issue.

newParentKeystringNoNew parent, if subtask.

Return type

string

The return value represents the key of the duplicated issue.

Example

Example 1

cloneIssue("PRJ-343");
//"PRJ-343" represents the key of the issue that will be duplicated.

Result: Issue PRJ-343 is duplicated.

Example 2

cloneIssue("PRJ-267","Cloned Issue")

Result: Issue PRJ-267 is duplicated and a link named Cloned Issue to the duplicated issue is created.

See also