Hi Everyone,
I have tried customizing many of the scripts that I have seen in these community responses, but I just cannot find one that works exactly and all of my attempts at making it work on my own have failed. Please help if you can. I really appreciate your time!
Lesley
I am currently using this script to try and update the assignee of a newly created issue to the value of a custom field (user picker, single select). I am copying the custom field from its linked issue, but it may be that the issue isn't getting fully created before it tries to run this script and doesn't know the value of the custom field yet.
If you have a better idea, here is my use case: an issue is auto-created as a linked issue (that's working), and I want to set the assignee of this new issue to the value of a custom field, which was filled-in on the original issue.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
def CustomFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_15741")
ApplicationUser user = issue.getCustomFieldValue(cField) as ApplicationUser
UserManager userManager = ComponentAccessor.getUserManager();
issue.setAssignee((user))