Hi!
I have a JMWE Wokrflow post function "Set field value (Groovy)". In my function i need to set a value of a custom "Multiple user picker". The code is working perfectly fine and returning an ArrayList with user names, but the field doesn't show up when viewing an issue.
What type of value should I return to the Result variable in order to fill a multiple users field?
Hi Gleb,
To set a multi-user picker field, you need to return a comma-separated usernames or a collection of ApplicationUser objects. Do you see any error in the log (atlassian-jira.log file) file? You can activate the error reporting in the post-function configuration (scroll down to the end of the post-function configuration), save the post-function, publish the workflow and retry. The error will be shown on the issue view screen/ transition screen after you trigger the transition. Also, did you check that the field is available on the issue view screen?
Regards,
Radhika
Hi!
Thanks for responding, I'll modify the script to return usernames.
While you're at it, can you please tell me what is going on here:
The same user, but getUserByName method is literally not working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Administrator" is the display name and "admin2" is the username. And the method expects the username.
Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, in the second screenshot, "admin2" is the user key, which is an immutable user identifier - the username is also unique, but can be modified by the user or the administrator.
The getUserByName method expects a username (which is what you input on the Jira login screen), and the getUserByKey expects a user key, which is really an internal id. Note that, by default, the user key is the lowercase version of the username, but since the username can be changed, they might end up being completely different.
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.