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:
- Assigns the ticket to someone
- Changes the ticket type
- Moves the ticket to a new project
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.