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

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

please help

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,743 views 1 5
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