I am trying to set the Assignee field to the value of a custom field that has users using ScriptRunner in a post function and it is not working. I know the custom field name and the custom field ID. Could the issue be that these fields ar not compatible?
When I try to use the ScriptRunne build-in script to copy field values, the Assignee field is not shown as a option as a target field.
Hi Carlos,
Assignee is a bit of an odd one because it's not just a simple user field, it's a system field with a whole pile of protections and extra code around it.
You can't really just "copy" by editing, you have to "assign" the issue. (The Jira UI makes it look like an edit in a lot of places!)
You are going to have to write a manual script to do this, but if you're on a recent version of Scriptrunner (one with HAPI in it), it's very short:
def myUser = issue.getCustomFieldValue('My user').value
issue.set {
setAssignee(myUser)
}
Hi Nic, That explains a lot. My ScriptRunner is pretty recent. I will give it a try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.