I am writing a bash script (attached it the script snippet). I was able to pull the crowd groups, but I want to also be able to pull all users within those groups as well. Is there a way to do so?
curl -s -k -u test:west \
-H "Accept: application/json" \
"https://crowd-dev-gc.nasawestprime.com/crowd/rest/usermanagement/latest/search?entity-type=group" \
| jq -r '.groups[].name' > groups_only.csv
Hi @haneen.m.elsaad - I would recommend the atlassian-python-api library, where you first fetch all members of a group and then loop through each member to retrieve their details.
https://atlassian-python-api.readthedocs.io/crowd.html
# Get group's members
crowd.group_members(group, kind='direct', max_results=99999)
# Get user
crowd.user(username)
Hey there @haneen.m.elsaad ,
Please refer to the Crowd REST API reference docs.
It sounds like Get Group Members may be able to pull the information you're looking for:
curl --request GET \ --url 'http://{baseurl}/rest/rest/admin/1.0/groups/{groupId}/users' \ --header 'Accept: application/json'
Hope this helps! =]
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.