-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
1
-
Severity 3 - Minor
-
A new endpoint got released which allows Admins to grant product roles to users through the below API endpoint:
curl --request POST \ --url 'https://api.atlassian.com/admin/v1/orgs/{orgId}/users/{userId}/roles/assign' \ --header 'Authorization: Bearer <access_token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "atlassian/user", "resource": "ari:cloud:platform::site/70ef3a32-d0da-4e09-b35e-0109f91969c3" }'
While this works well for most products, it won't work for Jira Administration (Product Admin role). This is caused by an incorrect resource which returns the following error:
{"errors":[{"id":"...","code":"ADMIN-UAM-400-5","status":"400","title":"Empty/Invalid Resource","detail":"Cloud Resource is invalid"}]}
The incorrect resource is provided via the output of the GET Workspace API. The output looks like:
"id": "ari:cloud:jira-admin::site/SITE_ID",
The only format accepted by the Grant User Access API is (which is also the only known workaround):
"role": "atlassian/admin", "id": "ari:cloud:jira::site/SITE_ID",