Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

New users' group problem when created via API v3

Felipe Kogati January 7, 2021

Hi all!

 

I'm tying to create a new user with api v3 (/rest/api/3/user) without any group.

When a make a POST request, a new user is created normally, but he is created with jira-software-users group

 

My Default Access Groups config is correct:

 

cinfigjira.jpg

 

And when I create a new user via UI, this does not happen.

 

That's my code:

def create_jira_user(email, fullname):
url = "https://mycompany.atlassian.net/rest/api/3/user"
payload = json.dumps({
"emailAddress": email,
"displayName": fullname
})
response = requests.request(
"POST",
url,
data=payload,
headers=headers,
auth=get_jira_authorization()
)
print(json.loads(response.text))

 

Searching on API (https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-post). I can send some Additional Properties, but didn't find any sample to help me.

Am I doing something wrong? Is there a way to send some Additional Properties that new user is created without or a specific group (that does not have some product access).

 

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2021

Hi @Felipe Kogati 

Welcome to Community! with your code, this shouldn't add the user into any group, given that you've disabled the default access group for "jira-software-users" under Product access. Do you have Atlassian access subscription on your organization? it could explain why the default group keeps getting added.

Felipe Kogati January 8, 2021

Hi @Prince Nyeche 

 

Thanks for your fast response :]

No, we don't have Atlassian Access subscription :/

Do you know the diference between create an user via API or via UI? Or and an example how can I send Additional Properties via API?

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2021

Additional properties is referring to this endpoint if any has been created on your Instance. I have a Free Addon I created, it basically uses REST API simple structures, you can also view the codes on Github to see how I implemented it. you can give it a go and see if it works as expected for you. As far as I know that should just work except something wrong is going on which isn't shown on your codes here.

Felipe Kogati January 8, 2021

 

Hi @Prince Nyeche  !

 

Thank you very much for your support!

I've tried everything, without success :/

 

I solved this issue checking and removing all default groups that were assigned to the new created user, via API.

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events