Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do i assign someone to a jira ticket on creation. (The name has spaces in it)

Robbe Van Nespen March 31, 2022

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.

1 answer

1 accepted

0 votes
Answer accepted
Artur Moura
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2022

Hi @Robbe Van Nespen

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.

Robbe Van Nespen April 4, 2022

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?

Artur Moura
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2022

Hi @Robbe Van Nespen

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.

Robbe Van Nespen April 4, 2022

Update: It worked when using the username parameter. Ty very much

Like Artur Moura likes this
Artur Moura
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2022

You are very welcome @Robbe Van NespenThanks for sharing the solution! 

Suggest an answer

Log in or Sign up to answer