How to get Bamboo users and groups when connecting to Jira/Crowd
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Sometimes we need to get details from users and groups programmatically when Bamboo is connected to Jira/Crowd.
This information is not available in Bamboo database but we can get this directly from Jira/Crowd using the same requests Bamboo does.
Solution
These are the requests done by Bamboo to get users, membership and groups:
Get users
1
2
3
4
5
curl -H "Accept: application/xml" \
-H "Content-Type: application/xml" \
-d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><null-search-restriction/>' \
-X POST '<JIRA_OR_CROWD_URL>/rest/usermanagement/1/search?entity-type=user&start-index=0&max-results=-1&expand=user' \
--user <APPLICATION>:<PASSWORD>
Get groups
1
2
3
4
5
curl -H "Accept: application/xml" \
-H "Content-Type: application/xml" \
-d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><null-search-restriction/>' \
-X POST '<JIRA_OR_CROWD_URL>/rest/usermanagement/1/search?entity-type=group&start-index=0&max-results=-1&expand=group' \
--user <APPLICATION>:<PASSWORD>
Get membership
1
2
3
curl -H "Accept: application/xml" \
-X GET '<JIRA_OR_CROWD_URL>/rest/usermanagement/1/group/membership' \
--user <APPLICATION>:<PASSWORD>
Get events
1
2
3
curl -H "Accept: application/xml" \
-X GET '<JIRA_OR_CROWD_URL>/rest/usermanagement/1/event' \
--user <APPLICATION>:<PASSWORD>
⚠️ Please make sure you change the <JIRA_OR_CROWD_URL> to your JIRA or Crowd url, also <APPLICATION> and <PASSWORD>. You should use the same credentials used by Bamboo to get the same results.
Was this helpful?