CLI Issue Cloning

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 

cloneIssue 

Create a new issue by copying an existing issue. 

cloneIssues

Clone issues returned from a JQL query. 

cloneProject

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

(tick)

(tick)

(tick)

(tick)

(tick)

  • Copy subtasks

    • JIRA 6.4 and higher

    • Since release 5.2

  • Copy attachments

    • JIRA 6.4 and higher

    • Since release 5.3

  • Copy links

    • Since release 5.7

  • Copy subtask estimates

    • Since release 5.7

  • Copy watchers

    • Since release 5.7

  • Copy comments

    • Since release 5.7

  • Copy watchers

    • Since release 5.7

  • Use parent versions

    • Since release 5.7

  • Field excludes

    • Since release 5.7

CLI specific cloning of an issue by copying fields similar to creating a new issue with the parameters coming from the original issue.

  • Since release 4.5 for JIRA 7.0

  • Since release 5.0 for JIRA 6.x

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

(tick)

(error)

(tick)

(tick)

(tick)

  • (tick) Advanced customization

    • propertyPrefix

  • (tick) Copy links (removed since 5.7)

  • (tick) Copy attachments (removed since 5.3)

  • (tick) Copy subtasks (removed since 5.3)

  • (tick) Copy comments (removed since 5.7)

  • (tick) Copy watchers (removed since 5.7)

  • (tick) Copy subtask estimates (removed since 5.7)

  • (tick) Use parent versions (removed since 5.7)

  • (tick) FieldExcludes (removed since 5.7)

  • (tick) Request parameters

Requires Clone Plus for Jira being installed on the server.

  • Specific customized actions can be used by specifying the appropriate propertyPrefix

  • See examples provided below

Simple

(removed)

(tick)

(tick)

(tick)

(error)

(error)

  • (tick) Copy links (removed since 5.7)

  • (tick) Copy attachments (removed since 5.3)

  • (tick) Copy subtasks (removed since 5.2)

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 comments

In some case, some view restricted comments will not be copied to prevent the comment becoming visible elsewhere. Here are the rules:

  1. All comments are copied when going to the same project whether they have view restrictions or not.

  2. Any view restricted comment will retain the same restrictions when copied.

  3. All view restricted comments that are restricted by group are copied.

  4. All view restricted comments that are restricted by a project role restriction will NOT be copied when the clone is to a different project.

Only comments visible to the user doing the clone are eligible to be copied.

These are the same rules as Clone Plus

Examples Using Clone Plus

CSV (Comma Separated Values)

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.