Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,327
Community Members
 
Community Events
175
Community Groups

Clone JIRA Ticket using REST API?

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)

3 answers

1 vote

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

Thank you Mohamed,

i also agree :)

/rest/internal/2/issue/issue-key/clone

Post? 

-Body "{"summary":"CLONE - test","optionalFields":{},"includeAttachments":true}"

Not found in API documentation? catch with developer console.

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.

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.

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.

0 votes

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.

Suggest an answer

Log in or Sign up to answer