Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Duplicate of a Jira Issue using API?

Sandeep Sharma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 18, 2019

Hey I know the cloning of tickets is not provided in Jira API. So, i was trying an alternative way. 

1) Extract all the fields of an issue.
2) create a new issue and update all the fields from the previous issue.

3) link both the tickets 

 

Problem -> is there any alternative way, because i am not able to pass all the fields of parent ticket to duplicate ticket using the Create_issue() function. 

When i try this,
new_issue=jira.create_issue(fields=parent_issue.raw['fields'],preftech=True)

it gives an error 

jira.exceptions.JIRAError: JiraError HTTP 400 url: https://teamipreo.atlassian.net/rest/api/2/issue

 

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
January 28, 2021

Hi! 

You can fetch the object as json, then build a json to push with linked ticket to parent one.

https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/jira.py#L928

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events