Hi everyone,
We are deploying JIRA across several teams, and I am looking for a way to streamline the process for moving issues between projects. For example, say an issue needs to go from Project A to Project B. Currently, the lead for A has to (or should) set the Assignee to 'Unassigned,' revert the Status to 'To Do,' and then do the move procedure.
I would like to have a listener take care of changing the Assignee and the Status fields, so that the lead only has to worry about moving the issue. This will resolve problems we are having with the Project B team receiving an issue from A but being unaware as it's showing as assigned and in progress with a Project A resource.
Currently this is the code I have in the listener and there are no errors in the log, but the changes are not being saved. I somehow need to use IssueManager.UpdateIssue(), but I can't get it to work. Any help is appreciated:
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
IssueManager issueManager = ComponentAccessor.getIssueManager();
Issue issue = issueManager.getIssueObject(event.issue.id)
log.warn("Event: ${event.getEventTypeId()} fired for ${event.issue} of type ${issue.getIssueType().id}")
if (issue.getIssueType().id=="10200"){
log.warn("Issue type check passed")
issue.setStatusId("2")
issue.setAssignee(null)
} else (log.warn("Issue type checking failed"))