Hi,
Is there an official endpoint to get the roups associated with a specific product (e.g. Jira Core, Confluence)?
Currently I'm guessing the product from the group name/description using regex, which is fragile.
Hi, I would suggest using this Python script for retrieving this data:
# --- Atlassian details ---
site = "https://yourcompany.atlassian.net"
email = "you@company.com"
api_token = "your_api_token"
# Product keys to check
products = {
"jira-software": "Jira Software",
"jira-servicedesk": "Jira Service Management",
"jira-core": "Jira",
"confluence": "Confluence",
}
# Store results here
group_product_map = {}
for app_key, product_name in products.items():
start_at = 0
max_results = 50
while True:
url = f"{site}/rest/api/3/group/bulk"
params = {
"accessType": "user",
"applicationKey": app_key,
"startAt": start_at,
"maxResults": max_results,
}
response = requests.get(
url,
params=params,
auth=(email, api_token),
headers={"Accept": "application/json"},
)
if response.status_code != 200:
print(f"Failed for {product_name}: {response.status_code} - {response.text}")
break
data = response.json()
groups = data.get("values", [])
for group in groups:
group_name = group.get("name") or group.get("groupName") or group.get("groupId")
if not group_name:
continue
if group_name not in group_product_map:
group_product_map[group_name] = []
if product_name not in group_product_map[group_name]:
group_product_map[group_name].append(product_name)
if data.get("isLast", True):
break
start_at += max_results
# Print results
print("\nGroup -> Products")
print("-" * 50)
for group_name, product_list in sorted(group_product_map.items()):
print(f"{group_name} -> {', '.join(product_list)}")
Hi @safa sahli
There is a solution, use the Admin API v2 role-assignments endpoint.
1. Get your Directory ID
| GET https://api.atlassian.com/admin/v2/orgs/{orgId}/directories Authorization: Bearer <org-api-key> |
2. Get product access per group
| GET https://api.atlassian.com/admin/v2/orgs/{orgId}/directories/{directoryId}/groups/{groupId}/role-assignments Authorization: Bearer <org-api-key> |
The response includes resourceOwner (e.g. jira-software, confluence, cmdb) and roles (atlassian/user, atlassian/admin), exactly what you see in the Admin UI Apps tab, no regex needed.
If you are comfortable writing python u can use the above to get all Groups that give that are associated with each product.
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.
Hey @safa sahli
I tried to search for it, but there is no official atlassian admin API endpoint to get groups filtered by product.
What you can do, you can use organizations REST-API to get all the groups in the organization.
It will not filter groups by product, but it will list them all.
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.