I have 15 post-function sub-tasks that all have almost the same exact format in which I set the assignee and additional assignee(custom field).
For this particular sub-task, I cannot get the sub-task to set the assignee correctly to the username I have, instead, once the sub-task is created, the Assignee is only set to the username text and not the actual agent and if I try to select from the Assignee drop-down list, it also just lists the username text from the script and I can no longer select their normal Jira full name from the drop-down list in the parent ticket and sub-tasks related. If I go to any other ticket and/or sub-task, I can select them normally as an Assignee. Once I unassign the original sub-task or assign to someone else, I can then also select the agent from the drop-down list normally. When looking at the ticket Activity, I noticed something strange, it sets the assignee to some generic Jira Username with numbers, screenshot attached.
Below is the script
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
issue.setAssigneeId("User1")
issue.setDescription("--Remove user's name from telephone description\n--Change telephone owner to anonymous\n--Delete voicemail account\n--Delete extension from AD account")
