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)
log.info "Issue with summary ${clonedIssue.key} created"
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.