CLI Issue Cloning
Description
The JIRA CLI provides various support around cloning issues. A number of techniques are used to provide this capability to cover the variety of use cases in this area. However, this broad support of scenarios make the description of the support and associated dependencies more complex. This page is provided to help describe this support.
Starting with Release 5.7, we have completed a transition to move all cloning to the Advanced Clone support with the exception of Clone Plus specific requests. This provides standardized and consistent processing and improved quality. Another reason is to provide better cloning support for Cloud.
Incompatibility with automatic linking
Using native cloning does NOT automatically link the issues with the Cloners link like the UI does. You need to specifically add the link parameter or do later with a linkIssue action. This means that as we convert more use cases to use native cloning the behavior will change. Example: add –link Cloners to the action.
Actions for Cloning
Action | Description |
|---|---|
Create a new issue by copying an existing issue. | |
Clone issues returned from a JQL query. | |
Create a new project as a clone of a base project with option to clone all the issues. |
Cloning Scenarios
The scenario the CLI uses depends on the parameters provided on the action.
Scenario | Server | Cloud | Change Summary | Change Other Fields | Change Project or Issue Type | Special Requests Allowed | Description |
|---|---|---|---|---|---|---|---|
Advanced Clone |
|
|
|
|
|
| CLI specific cloning of an issue by copying fields similar to creating a new issue with the parameters coming from the original issue.
Note that with this option that any special requests are ignored if you don't have Clone Plus installed and we have to default to this scenario. Use link parameter You need to explicitly use the link parameter if you want a link between the original issue and the cloned issue. This is different that the other implementation options, but is a more natural automation protocol. To be equivalent to the UI based options use: --link Cloners. |
Clone Plus |
|
|
|
|
|
| Requires Clone Plus for Jira being installed on the server.
|
(removed) |
|
|
|
|
|
| Behaves like the standard JIRA UI clone action. Use one of the special requests list to force using the UI approach. Since CLI 5.7, this option is no longer provided. |
Cloning Considerations
Recommend using autoVersion and autoComponent
When cloning issues to another project, the clone will fail if the target project does not contain versions or components referenced on issues. autoVersion and autoComponent parameters will guard against that. Alternatively, when cloning a project, you can use copyVersions and copyComponents.
Option | Discussion | Reference |
|---|---|---|
copySubtaskEstimates | Not fully supported with Legacy time tracking. | JCLI-1070 - Getting issue details... STATUS |
copyComments | Author cannot be preserved due to a JIRA limitation. Copied comments will have the current user as the author. | JCLI-1071 - Getting issue details... STATUS |
copyComments | Rules for coping restricted commentsIn some case, some view restricted comments will not be copied to prevent the comment becoming visible elsewhere. Here are the rules:
Only comments visible to the user doing the clone are eligible to be copied. | These are the same rules as Clone Plus |
