Forums

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

Add user to group using API

Asra Nousheen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 11, 2018

Hi, I am trying to add an user to group using bitbucket api.

But failing because of naming exceptions.

Bitbucket Version: 5.5.4.

 

POST https://bitbucketURL/rest/api/1.0/admin/groups/add-user

{
"context": "NewGroup",
"itemName": "test1"
}

 

Error:

{"errors":[{"context":null,"message":"No user named 'test1' was found","exceptionName":"com.atlassian.bitbucket.user.NoSuchUserException"}]}

 

Can someone please tell me what is wrong in this

1 answer

0 votes
Lonnie
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2018

Hello, I use the following syntax:

 

curl -k -u <ADMIN>:<PASSWORD> -X PUT -H "Content-Type: application/vnd.atl.plugins.plugin+json" -d '{"name": "userID","displayName": "USER_NAME","email": "userID@company.com"}' https://<bitbucketURL>/rest/api/1.0/admin/group/add-user

 Having said that, this works only for internal directories

 

I hope this help 

Lonnie

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events