I am currently making a tool that automatically makes jira tickets, I would like to assign someone to the jira ticket with their name or email. Since i don't know how to get the jira account id. But it is giving me a bad response, i was wondering if i am able to assign someone to a jira ticket when there are spaces in the name.
Any help is welcome.
There is no official way to assign issues using other attributes than using the *name* attribute, which is the *username* attribute.
Therefore, I believe the workaround is using the user-findAssignableUsers REST API endpoint, informing the issue key (i.e ITSM-1) so you may find all the users that can be the assignee of the issue.
<jira-url>/rest/api/2/user/assignable/search?issueKey=ITSM-1
The results of this command will give you all the user information like displayName or emailAddress where it seems the information you have.
Hope it helps.
I have the displayName and emailAddress, but i cannot assign someone based on those. I have tried that with the *name* attribute and they continue to give an error. When i looked online it's because the displayName has spaces in it.
And the email address doesn't work.
Did i miss something or am i right in assuming displayNames with spaces in them do not work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are right, using the DisplayName or emailAddress attribute will not work, you will need to use the *username* attribute, which doesn’t have space on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update: It worked when using the username parameter. Ty very much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome @Robbe Van NespenThanks for sharing the solution!
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.