You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
i want to clone issue project A to project B via JIRA REST API.
is there any solution directly use JIRA REST API?
if no solution, I'd like to try cloning in the way below.
please give me good opinions, thank you
<second solution>
1) all ticket search from project A (using rest/api/2/search)
2) create issue to project B (using above ticket list AND using rest/api/2/issue)
Hi,
There is no api to clone issue. You need to get the data of each issue
GET /rest/api/2/issue/{issueIdOrKey}
Then create a new issue in the project B.
POST /rest/api/2/issue
https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-createIssues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
/rest/internal/2/issue/issue-key/clone
Post?
-Body "{"summary":"CLONE - test","optionalFields":{},"includeAttachments":true}"
Not found in API documentation? catch with developer console.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This does not seem to work and yields HTTP error 404. Can you please elaborate about under which circumstances and in which Jira versions (8.22.x for me) this API can be used? Maybe you have a working example in Java or at least a curl command for the community here. I am a normal user without admin rights (only project admin) or access to whatever this developer console is supposed to be.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @kriegaex This works for me in Jira Cloud, basically what I'm doing is clone an issue for test and then catch the API call that clones the issue in the browser's developer console, I'm not sure if that's the case for Jira DataCenter but you can try the steps I described above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh OK, you just mean the browser's developer console. I mistook your hint for being about a dedicated tool for Jira developers. Unfortunately, in the data centre version of Jira, what the browser does is not so clear. It does no simply send a REST call to an internal end point like the one which seems to work in the cloud version. At least, it is not something I can easily identify in the "network" tab. Instead, it does some JS magic and XHR stuff. I do not feel so inclined to debug that with an uncertain outcome, not being a JS buff.
Anyway, thanks for trying to help me. I hope that someone else comes up with a way to do this. For now, I am using the Jira Java REST API library, for which I have hacked a simple "deep clone" for my own purposes, focusing on the fields I need to be cloned. Tha is not a generic solution, but serves my purpose. It would be better if Atlassian would expose the clone functionality in their public REST API, though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @JJJ,
You can also try our Jira cloud app Deep Clone for Jira.
It's possible to bulk clone thousands of issues at once and move them to other projects or instances. With the Deep Clone REST API you can automate cloning issues with your scripts.
We offer many other advanced cloning features that might be helpful for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.