Hi,
I have a drop down list - To Queue having values (Service Desk, IT- Imaging and so). If i choose service desk, in the assignee field i should get list of users on the Group Service Desk. I tried to use the script below but i am having an error of deprecation comment in the line - userToReassign = userUtil.getUserObject("Service Desk")
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.user.util.UserUtil
import org.apache.log4j.Level
import com.atlassian.jira.component.ComponentAccessor
log.setLevel(Level.DEBUG)
log.debug "Starting postfunction..."
if (issue.isSubTask()) {
log.debug "Issue is subtask, leaving."
return
}
def tr = customFieldManager.getCustomFieldObjectByName ("To team")
def trValue = issue.getCustomFieldValue(tr) as String
def userToReassign = issue.getAssignee()
log.debug "Got assignee ${userToReassign}."
UserUtil userUtil =ComponentAccessor.getUserUtil()
if (trValue == "Service Desk") {
userToReassign = userUtil.getUserObject("Service Desk")
// issue.setResolution(resolutionManager.getResolutionByName("Closed successful"))}
//issue.setAssignee(ComponentManager.instance.userUtil.getUserObject('john_smith')
}
log.debug "Setting user to ${userToReassign}."
issue.setAssignee(userToReassign)
Kindly let me know what is the new code to replace the above.
Thanks
Swarna