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
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
Hi @ZhangXiaoyu ,
welcome to the Atlassian community!
Please, could you specify your use case? Do you need to clone issues as part of transition in a workflow or based on an issue event?
Btw, here a useful starting point for your request https://scriptrunner.adaptavist.com/5.6.8/jira/recipes/workflow/servicedesk/clone-issue-sd.html
Hope this helps,
here an useful code :
IssueFactory issueFactory = ComponentAccessor.getIssueFactory();
IssueManager issueManager = ComponentAccessor.getIssueManager();
ProjectManager projectManager = ComponentAccessor.getProjectManager();
ApplicationUser currentUserObj = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
Project destinationProject = projectManager.getProjectByCurrentKey("YOUR DESTINATION PROJECT KEY HERE");
MutableIssue newissue = issueFactory.getIssue();
//OTHER FIELDS HERE
issueManager.updateIssue(currentUserObj, newissue, EventDispatchOption.DO_NOT_DISPATCH, false);
Please, try it!