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

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

Rahul Mohan February 25, 2014

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

0 votes
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
February 25, 2014

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.

Rahul Mohan February 26, 2014

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

1 vote
Rahul Mohan March 17, 2014

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.

0 votes
TimP
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.
February 25, 2014

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

Rahul Mohan February 25, 2014

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

Rahul Mohan February 27, 2014

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.

TimP
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.
February 27, 2014

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

0 votes
Rahul Mohan February 25, 2014

please help

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events