Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.event.type.EventDispatchOption;

def issueManager = ComponentAccessor.getIssueManager();

//def currentIssue = Issues.getByKey("TEST2-2") as MutableIssue
def currentIssue = event.issue as MutableIssue

def components = currentIssue.getComponents()

//如果存在多个模块,这里只取第一个模块的lead
def componentLeader = components.getAt(0).componentLead
currentIssue.setAssignee(componentLeader)
issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), currentIssue, EventDispatchOption.ISSUE_UPDATED, true);
                 



  • No labels