I tried to assign ticket using following script, but doens't work. Is there anything wrong? Many Thanks!
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def requestCf = customFieldManager.getCustomFieldObjectByName("Customer Request Type")
def requestType = issue.getCustomFieldValue(requestCf) as String
if (requestType == "SD") {
issue.setAssigneeId("eyazici")
}
Hello,
try to change line
issue.setAssigneeId("eyazici")
with
def issueManager = ComponentAccessor.getIssueManager();
MutableIssue mutableIssue = issueManager.getIssueObject(issue.id) mutableIssue.setAssigneeId("eyazici")
mutableIssue.store();
and add following line to the imports
import com.atlassian.jira.issue.MutableIssue
Regards,
Milos
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.