import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.user.ApplicationUser
/**
* create issue
*/
def mutableIssue = ComponentAccessor.issueFactory.getIssue();
def issue = ComponentAccessor.issueManager.getIssueObject("WOR-1") as Issue;
def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser as ApplicationUser
mutableIssue.setSummary("summary test")
mutableIssue.setProjectObject(issue?.projectObject)
mutableIssue.setIssueType(issue?.getIssueType())
mutableIssue.setReporter(currentUser);
ComponentAccessor.issueManager.createIssueObject(currentUser,mutableIssue); |