Details
Description
The assignee set in an initialiser using the following script is not set if the user picker returns multiple results and the required user is not the first one.
To reproduce this login as user with username "admin" and create a user with display name "Other admin". Setup a behaviour with an initialiser containing the following code:
import com.atlassian.jira.component.ComponentAccessor import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript import static com.atlassian.jira.issue.IssueFieldConstants.ASSIGNEE @BaseScript FieldBehaviours fieldBehaviours def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() getFieldById(ASSIGNEE).setFormValue(currentUser.name)
The user picker call to /rest/api/2/user/picker will return more than one result and the required user will not be the first one in the list.
We need to do an exact search which the user picker endpoint does not provide. Excluding certain names may work but it's probably best to have our own endpoint to return an exact match on username.
Attachments
Issue Links
- is related to
-
SRJIRA-68 setFormValue on the assignee does not format the assignee correctly
-
- Done
-
-
SRJIRA-2208 Scripted Conditions do not pull the current issue information when activated from a transition post-funcion
-
- To Do
-