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
Next: Root
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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
We have a listener for the following functionality:
Whenever a ticket is created, if the issue summary is a specific value, it does the following:
I'm able to do #1 and #2 without any problems. For #3, I tried updating the Project Id but it seems to keep the issue in the same project, not the new project.
How can I programmatically move an issue from one project to another. Do I need to recreate this ticket in the new project, and then delete the ticket from the old project?
I understand the configurations in both projects need to be the same, that's not an issue (nor will it be an issue in the future)
I don't think it helps much, but here are the relevant parts of the code I currently have
MutableIssue issue = event.issue as MutableIssue
// Omitted code:
// 1) Logic to check the summary and continue if not relevant
// 2) Update assignee
// 3) Change ticket type
// Move the issue to the Data Recon project
issue.setProjectId(12100)
ComponentAccessor.getIssueManager().updateIssue(user,issue,EventDispatchOption.ISSUE_UPDATED, false)
Everything but the project is getting updated, so the updateIssue call is going through, just not for the project.
Hello,
I know it's a bit late, but I also had this problem and I just solved it.
In summary, what you have to do is change the project of the original issue and recreate it, in this way you make an update indirectly.
For example:
The issue's attachments break when I try this. The rest of the fields move successfully to the mentioned project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dymas Coelho I think your code would work with any other field, the problem is that you are changing the project id.
In my opinion, you should clone the issue with IssueFactory.
def newIssue= issueFactory.cloneIssue(issue)
newIssue.setProjectId(XXXX)
Map<String,Object> newIssueParams = ["issue":newIssue] as Map<String,Object>
issueManager.createIssueObject(user,newIssueParams)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dymas Coelho I'm sorry but it is not as simple. You can try to Move issue manually and you will see what must be solved.
Check this thread: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Move-Jira-issue-from-one-project-to-another-project/qaq-p/960195
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.