Migrate issues (including fields like summary, description, assignee, labels, etc.) from one Jira project to another using Node.js and the Jira REST API.
const client = require('./helpers/jiraClient');
const { jql, sourceProjectKey, destinationProjectKey } = require('./config');
async function fetchIssues() {
const res = await client.post('/search', {
jql,
maxResults: 50,
fields: ['summary', 'description', 'issuetype', 'assignee', 'labels'],
});
return res.data.issues;
}
async function createIssue(issue) {
const newIssue = {
fields: {
project: { key: destinationProjectKey },
summary: issue.fields.summary,
description: issue.fields.description,
issuetype: { id: issue.fields.issuetype.id },
labels: issue.fields.labels,
assignee: issue.fields.assignee ? { id: issue.fields.assignee.accountId } : null,
},
};
const res = await client.post('/issue', newIssue);
console.log(`Created issue: ${res.data.key}`);
return res.data.key;
}
(async () => {
try {
const issues = await fetchIssues();
for (const issue of issues) {
await createIssue(issue);
}
console.log("✅ Migration complete.");
} catch (err) {
console.error("❌ Error during migration:", err.response?.data || err.message);
}
})();
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.