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
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")
Hi @Midnite8 ,
you can get it using groovy script like this:
UserManager userManager = ComponentAccessor.getUserManager()
ApplicationUser user = userManager.getUserByName("username")
String userKey = user?.getKey()
Actually I don't know any easy way how to do it as a Jira administrator, so I asked myself here.
@Hana Kučerová, I found out another kind of workaround to find out the userKey. I have a DEV project and just normally set the username in the Groovy script, I then create the ticket as normal with the groovyscript in the post-function workflow and after the ticket gets created with the invalid username I set the assignee or Unassigned or myself and I can see from the Jira activity what the userKey is.
Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events