Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I am unable to clone the issue using script runner

Hemalatha I'm New Here Dec 17, 2021

I am unable to clone the isssue using script runner, can you help me ?

1 answer

2 votes

Hi @Hemalatha ,

this code should clone your ticket. Please add your ticket key where "YOUR_SOURCE_TICKET_KEY_HERE".

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueFactory

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def issueManager = ComponentAccessor.getIssueManager()
def issueObject = issueManager.getIssueByCurrentKey("YOUR_SOURCE_TICKET_KEY_HERE")
def clonedIssue = ComponentAccessor.getComponent(IssueFactory).cloneIssue(issueObject)

Map<String,Object> newIssueParams = ["issue" : clonedIssue] as Map<String,Object>
issueManager.createIssueObject(user, newIssueParams) "Issue with summary ${clonedIssue.key} created"

 Hope this helps,


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

768 views 24 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you