Hi,
when I want a number of projects, I may use: /rest/api/1.0/projects?limit=1000
but now, I should receive number of active users - how i may do it ?
Is '/rest/api/1.0/users' returning active users ?
thanks, Mike
Community moderators have prevented the ability to post new answers.
Hi Mike,
This REST end-point:
GET /rest/api/1.0/admin/permissions/users
will return users who have explicitly been granted a global permission (which means that they are licensed). And:
GET /rest/api/1.0/admin/permissions/groups
will similarly return groups who have explicitly been granted a global permission.
However neither will return users that inherit their permissions from a group. To determine the set of all users that are licensed you'd need to use the iterate through the groups returned by the /permissions/groups end-point and retrieve their members, using:
GET /rest/api/1.0/admin/groups/more-members?context=<group_name>
That said, there is an easier way. I put together a small plugin for tracing user permissions working on a support case a little while back. It's open source and available from:
https://bitbucket.org/tpettersen/user-permission-debugger
This plugin will return a plain text list of all users that have been granted a particular permission. There are some instructions for installation here:
Hope this helps!
cheers,
Tim
By-the-by, full documentation for our REST API is available here: https://developer.atlassian.com/static/rest/stash/latest/stash-rest.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks ! :)
/rest/api/1.0/admin/permissions/users - it works great :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks :) !
GET /rest/api/1.0/admin/groups/more-members?context=<group_name> - it wors great :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just wanted to add an update to this answer for others who have this issue, perhaps a change in recent versions of the stash REST API.
GET /rest/api/1.0/users?permission=LICENSED_USER[&limit=xxx]
is a good way to get all the users occupying licensed seats.
I wasn't able to find this in the documentation, but found it through trial-and-error in the REST API Browser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Mike,
That REST resource you mentioned should return all of the non-deleted users in Stash. Is that what you mean by 'active'?
What results are you seeing? Perhaps more importantly what are you looking to do with Stash?
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so, in my situation the active users - it's the users who have license to stash.
this query: '/rest/api/1.0/users' returns all users (even users who no have license)
How I may receive users who have license to stash (in rest query - I develop application in java, which counting statistics from stash) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.