How do i add 100 users in bulk to a group in STASH ?

I am looking for a way to add 100 users at once to a specific group which is created in STASH..

4 answers

1 accepted

This widget could not be displayed.

addUser (if user isn't already defined to Stash) and addUserToGroup from Stash Command Line Interface. Use runFromList if you have a simple list of user to add or one of the other run actions if the data is available as csv or sql.

Thank you guys.. i will try out and give you an update

This widget could not be displayed.

please help

This widget could not be displayed.

Hi Rahul,

I'd recommend using the Stash REST API to add the users to the group. The following resource allows you to add multiple users to a group at once:

POST /rest/api/1.0/admin/groups/add-users

The request payload should specify a group and the usernames to add, e.g.:

{
  "group": "group",
  "users": [
    "user2",
    "user1" 
  ]
}

See the documentation for that REST resource for more details: https://developer.atlassian.com/static/rest/stash/2.11.2/stash-rest.html#idp201344

If you're unfamiliar with REST, you may find this document helpful: https://developer.atlassian.com/stash/docs/latest/how-tos/command-line-rest.html

cheers,

Tim

Thank you guys.. i will try out and give you an update

Hi Tim,

I do not see the add-users api under the list of availabel apis in stash, i see only add-user. I tried adding mutiple user to this existing api, but this allows only one user addition at a time. please help me understand how to get the add-users apri on stash.

Hi Rahul,

I was under the impression that you were trying to bulk add users that already existed in Stash to a particular group.

If you haven't already created the users in Stash, you will first need to create them using the create user REST API:

https://developer.atlassian.com/static/rest/stash/2.11.2/stash-rest.html#idp296128

There is no API for creating more than one user at a time, so I would recommend creating a script that makes a single request for each user that you want to create.

cheers,

Tim

This widget could not be displayed.

addUser (if user isn't already defined to Stash) and addUserToGroup from Stash Command Line Interface. Use runFromList if you have a simple list of user to add or one of the other run actions if the data is available as csv or sql.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,310 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you