How to auto assign issue based on customer request type?

ANN LEE August 29, 2017

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")
}

1 answer

0 votes
MoroSystems Support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2017

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events