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.
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.
Hi @safa sahli
There is a solution, use the Admin API v2 role-assignments endpoint.1. Get your Directory ID
2. Get product access per group
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.
resourceOwner
jira-software
confluence
cmdb
roles
atlassian/user
atlassian/admin
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!
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 checkproducts = {"jira-software": "Jira Software","jira-servicedesk": "Jira Service Management","jira-core": "Jira","confluence": "Confluence",}# Store results heregroup_product_map = {}for app_key, product_name in products.items(): start_at = 0 max_results = 50while 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:continueif 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 resultsprint("\nGroup -> Products")print("-" * 50)for group_name, product_list in sorted(group_product_map.items()): print(f"{group_name} -> {', '.join(product_list)}")
Looks like related documentation here:
https://support.atlassian.com/user-management/docs/create-groups/
and here
https://developer.atlassian.com/cloud/admin/organization/rest/api-group-groups/#api-v2-orgs-orgid-directories-directoryid-groups-groupid-get
It looks like you're new here. Sign in or register to get started.