· Documentation · 3 min read
Jira Example - Bulk Clone Issues
The example shows how to use Script Master’s Script Console to clone up to 50 Jira issues from a JQL query — automating issue duplication quickly and efficiently.

Overview
This example demonstrates how to use Script Master’s Script Console in Jira Cloud to efficiently clone multiple issues at once using a simple Forge-based script.
With this example, Jira Administrators can run a script that takes a JQL query as input, retrieves matching issues through the Jira REST API, and automatically clones them — up to 50 issues per execution.
// You can use JQL to select Jira issues for cloning. You can clone up to 50 issues at a time
// Configuration variables
const jql = 'filter = 10001';
const cloneFields = [
'assignee',
'components',
'description',
'fixVersions',
'issuetype',
'labels',
'priority',
'project',
'summary',
// Other required system fields
// Add required custom fields as well
];
const newProjectKey = ''; // leave empty to create issues in the same project
const summaryPrefix = 'Cloned - '; // leave empty to create issues without any prefix
// Script
// Search for issues using JQL https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get, pay attention, only first 50 issues will be returned
const issuesResponse = await requestJira(`/rest/api/3/search?jql=${jql}`, {
headers: {
Accept: 'application/json',
},
});
const issuesData = await issuesResponse.json();
const output = [];
for (const issue of issuesData.issues) {
const newIssue = { fields: {} };
for (const cloneField of cloneFields) {
newIssue.fields[cloneField] = issue.fields[cloneField];
}
if (newProjectKey) newIssue.fields.project = { key: newProjectKey };
if (summaryPrefix) newIssue.fields.summary = `${summaryPrefix}${issue.fields.summary}`;
// Create issue https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post
const response = await requestJira(`/rest/api/3/issue`, {
method: 'POST',
headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify(newIssue),
});
if (response.status === 201) {
const clonedIssue = await response.json();
output.push(`${issue.key} is cloned as ${clonedIssue.key}`);
} else {
const clonedIssueError = await response.json();
output.push(`${issue.key} is not cloned because of ${JSON.stringify(clonedIssueError)}`);
}
}
return output.join('\n');How It Works
- Admin Input – You provide a JQL query to select the issues you want to clone.
- Issue Retrieval – The script uses the Jira REST API to fetch all issues matching your query.
- Cloning Process – Each issue is cloned into a new one, while maintaining key field values and ensuring uniqueness where required.
- Logging Results – The script logs the newly created issue keys for easy reference.
To maintain performance and reliability, the script limits cloning to a maximum of 50 issues per run and includes error handling to manage potential conflicts or API issues gracefully.
Why Use It
Bulk cloning is a common administrative task — especially when creating templates, migrating issue sets, or duplicating sprint backlogs.
This script automates the entire process, ensuring that it’s fast, consistent, and repeatable, without needing any external tools or Marketplace apps.
Compatibility:
This example is available in the Jira version of Script Master, within the Script Console module.

