Skip to main content
Skip table of contents

Deep Clone for Jira REST API

Leverage Deep Clone’s REST API to automate issue cloning in Jira. Supports single, bulk, and project cloning with detailed examples.

You can utilize Deep Clone's REST API if you want to automate cloning issues with your scripts or use it in a Jira Automation.

We offer a Rest API for the following features:

You can find the in-app documentation with request examples and your User and Password under Apps > Manage Apps > REST API.

Deep Clone REST API menu

Authentication

To authenticate against the REST API, you need to use Basic Auth using the “Authorization” header.

Please note that the Password and URLs for the REST API will change when changing the data residency location of Deep Clone for Jira.

Rate limit

You can send at least 4 requests in parallel. More requests might work, but don't rely on it. If you hit our rate limit, you'll receive a 429 Too Many Requests response status code.

Single Clone

To clone a single issue, send a POST request to https://deep-clone-for-jira.[REGION].connect.codefortynine.com/clone/rest/single/{originalIssueIdOrKey} with the application/json Content-Type header and the following JSON body:

You have to replace [REGION] with your hostname suffix. You can find out how to determine your suffix here.

JSON
{
    "projectId": "10000",         // The project ID to clone the issue into (project key won't work). Use -1 for "Same as original".
    "typeName": "Story",          // The issue type name to clone the issue into. Use -1 for "Same as original".

    "parentKey": "TEST-123",      // Only to be used (and required) if the issue type is a subtask: Which parent issue it should be attached to.
    "epicIssueKey": "TEST-123"    // Only if the issue type is not a subtask: The epic/initiative to be used as parent. If missing, no parent is set.

    "components": false,          // If components should be cloned, default: false.
    "createComponentsInTargetProjects": false, // If components missing in target projects should be created, default: false.
    "versions": false,            // If version fields should be cloned, default: false.
    "createVersionsInTargetProjects": false, // If versions missing in target projects should be created, default: false.
    "attachments": true,          // If attachments should be cloned, default: false.
    "comments": true,             // If comments should be cloned, default: false.
    "commentsWithDate": true,     // If comments are cloned, if they are prefixed with the original date. Default: false,
    "issueLinks": true,           // If issue links should be cloned, default: false.
    "issueLinkMap": {             // For a Bulk Clone, if only issue links between cloned issues should be kept, we need to know the
        "TEST-123": "CLONE-123",  // mapping between the original and the (so far) cloned issues. Issues yet to be cloned should be
        "TEST-124": null,         // mapped to null so we don't clone the issue links to the original issues if issueLinkSkipUnknown
    },                            // is false. Default: empty map.
    "issueLinkSkipUnknown": true, // If issue links to unknown (i.e. not part of issueLinkMap) issues should be skipped, default: false.
    "remoteLinks": true,          // If remote links should be cloned, default: false.
    "sprint": true,               // If the sprint value should be cloned, default: false.
    "cloneSprintToBoardId": 12,   // If set, the sprint value is cloned by creating a new sprint in the board with the given id.
                                  // If not set, the sprint value is cloned by reusing the existing sprint ID.
    "votes": true,                // If votes should be cloned, default: false.
    "watchers": true,             // If watchers should be cloned, default: false.
    "workLog": true,              // If work logs should be cloned, default: false.
    "workLogWithDate": true,      // If work logs are cloned, if they are prefixed with the original date. Default: false.
    "summaryPrefixEnabled": true, // If the issue summary should be prefixed.
    "summaryPrefix": "CLONE - ",  // Required if summary should be prefixed: The prefix for the summary.
    "editableFields": true,       // If the other editable fields should be cloned, default: false.
    "properties": true,           // If the issue properties should be cloned, default: false.
    "cloneIssueLink": true,       // If an issue link between clone and original issue should be added, default: false.
    "cloneIssueLinkType": "10000:inward", // Issue link type id and direction for cloneIssueLink, default: "clones" issue link, outward.
    "status": true,               // If the issue status should be cloned, default: false.
}

Note that requests can take a while, e.g., if the original issue has a lot of comments.

If the request was valid, you will receive the following response:

JSON
{
    "result": "SUCCESS",          // One of SUCCESS, WARNING or ERROR.
    "cloneIssueKey": "TEST-123",  // The newly cloned issue, or null if creating the issue was not successful.
    "message": null               // String containing an explanatory message, or null.
}

Bulk Clone

There is no special request for a Bulk Clone. Just call the Single Clone request repeatedly. For an Epic Clone, make sure to clone the Epic first, then include the issue key in the response as the epicIssueKey to clone all issues of the Epic.

Project Clone

To clone a project (without its issues), send a POST request to https://deep-clone-for-jira.[REGION].connect.codefortynine.com/clone/rest/project with the application/json Content-Type header and the following JSON body:

You have to replace [REGION] with your hostname suffix. You can find out how to determine your suffix here.

JSON
{
    "sourceProjectId": "10000",           // The project ID of the original project.
    "targetProjectKey": "CLONE",          // The key of the new project (must be unique).
    "targetProjectName": "Cloned Project" // The name of the new project (must be unique).
}

Note that only the project is being cloned, including its configuration, versions, and components, but without its issues. Team-managed projects are currently not supported.

If the request was valid, you will receive the following response:

JSON
{
    "clonedProject": { "id": "10001", ... }, // On success, the details of the cloned project, or null if not successful.
    "errorMessage": null                     // String containing an explanatory message if there were any warnings/errors, or null.
}

Rank Issues

After having cloned multiple issues, you can rank the issues according to the original order. To get the ranking of cloned issues, send a POST request to https://deep-clone-for-jira.[REGION].connect.codefortynine.com/clone/rest/rank/clonedIssuesRank with the application/json Content-Type header and the following JSON body:

You have to replace [REGION] with your hostname suffix. You can find out how to determine your suffix here.

JSON
{
    "ORIG-1": "CLONE-1", // We need the mapping of the original and cloned issues, so the cloned issues are ranked
    "ORIG-2": "CLONE-2", // in the same order as the original issues.
    "ORIG-3": "CLONE-3"
}

If the request was successful, you will receive a response with status code 200 OK and the following body:

JSON
{
    {
        "10019": [
            "CLONE-1",
            "CLONE-2",
            "CLONE-3"
        ],
        "10262": [
            "CLONE-3",
            "CLONE-2",
            "CLONE-1"
        ]
    }
}

In the response above, the Jira instance has two rank fields, customfield_10019 and customfield_10262. The issue rank for each field is included in the response.

Please note that at this point, the cloned issues have not been ranked yet. The response returned is only an indication of the intended ranking.

To actually rank issues, send a POST request to https://deep-clone-for-jira.[REGION].connect.codefortynine.com/clone/rest/rank/rankIssuesForField with the application/json Content-Type header and the following JSON body (similar to the Jira API endpoint):

JSON
{
    "rankCustomFieldId": 10019,
    "rankAfterIssue": "CLONE-1",
    "issues": [
        "CLONE-2",
        "CLONE-3"
    ]
}

If the request was successful, you will receive a response with status code 204 No Content.

Please note that a different request has to be sent for each rank field. If there are many issues to rank, the request might take a long time and eventually a timeout error. We recommend splitting the issues in batches of 50 issues, and sending a request for each batch.


Install Deep Clone for Jira

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.