Hello!
My username (login) is "sa" (Active Directory connector). Earlier, using IssueService, I created issues and there were no problems. After renaming the username to "id", I started getting an error:
"[assignee:User 'sa' does not exist.]"
[VALIDATION_FAILED]
I am not using the {{params.setAssigneeId()}} method.
Check:
import com.atlassian.jira.component.ComponentAccessor
def user = ComponentAccessor.userManager.getUserByName( "id" );
// result = "id(sa)"
It looks like I exist with a new name "id" and with an old key "sa".
This sounds like the usual expected api shenanigans with lacking documentation.
User key -- persistent String key being created when the user is created, it does not change
User username -- variable, this one can change, if you do change, the key remains the same
In old versions, it used to be the original username, so you would have the same userkey and username until username gets changed (perhaps your case). Later on the userkey started following a more "generic" convention of JIRAUSER12345 kind of an identifier, so it no longer is confusingly the same from the start.
In any case, the key and name may seem the same, but they are not. They are used differently across the api, sometimes it matches by username, sometimes by userkey. It's inconsistent.
When you look into the setAssigneeId() method, it does not say anything in javadoc https://docs.atlassian.com/software/jira/docs/api/8.13.6/com/atlassian/jira/issue/IssueInputParameters.html#setAssigneeId-java.lang.String-
But when you look at MutableIssue.setAssigneeId() https://docs.atlassian.com/software/jira/docs/api/8.13.6/com/atlassian/jira/issue/MutableIssue.html#setAssigneeId-java.lang.String- there it states
void setAssigneeId(String assigneeId)
Sets the user that this issue is assigned to. Note that this should be the userkey, not the username.
Parameters:
assigneeId - The user key
Then again as you did not show us how you are using the IssueService, I'm taking a guess.
Thank you very much!
You are absolutely right. The problem was really that setAssigneeId() is being used and not setAssignee().
Thanks again, problem solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.