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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

175 views 20 8
Join discussion

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