What I did.
・I got "accountId"(equals to "userId") of user account (existing at directory of my organization and it's status is "active") by calling 「Get users in an organization」Organizations REST API.
・I called 「Grant user access」Organizations REST API with setting the above "accountId" to "userId" path parameter, and collect values to another parameters("orgId" of path parameter, and "role" and "resource" at request body).
・All parameters including "userId" is collect, but「Grant user access」Organizations REST API retuens "404 not found" error, and the userId I set when caling this API and the one written in error message is different.
・I thought that "userId" and "accountId" may be different, but it's wrong. The "userId" and "accountId" is the same, because There are no APIs return "userId" parameter in it's response body, and Atlassian say "get userId by calling Get users in an organization API in official page."
Does anyone have the solution about this problem?
What API call are you executing and what documentation are you referring to?
Can you also provide details of the API call and the response?
Are you on Cloud or Data Center?
So the accountId you are using is not found, so this does not exist.
What is the accountId you get from:
userId and AccountId are the same in this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Marc -Devoteam-
Regarding the issue (I previously reported as being caused by a bug in 「Grant user access」API) , I got message that this bug is fixed from Atlassian.
So, I called this API again using the the same processes as before, and confirmed that the granting user permission operation is executed successfully and returned no errors.
Therefore, I realized that this issue was not due to my methods or processes, but to a bug.
I sincerely appreciate your cooperation.
Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Marc -Devoteam-
I just got the following response from Atlassian support team about this issue, and It turned out that this problem was caused by a bug of this API.
So, I will tell the detail of this bug when I got the responce from Atlassian support team.
Dear Mr./Ms. Suzuki,
We apologize for the delay in addressing this matter.
Our team's investigation has revealed that the issue is due to a bug in the API.
We are currently working on a fix.
We will contact you as soon as there is any progress, so please wait.
Thank you for your continued support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Marc -Devoteam-
Thank you for your repponse, and sorry for lack of my information.
These are the details:
API:「Grant user access」
Documentation URL: https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v1-orgs-orgid-users-userid-roles-assign-post
API Call is the following one:
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <api_key>" -d '{"role": "atlassian/user", "resource": "<jira_resource_id>"}' https://api.atlassian.com/admin/v1/orgs/<org_id>/users/<user_account_id>/roles/assign
※set the accountId got from 「Get users in an organization」API at <user_account_id>.
Response is the following one:
{"errors":[{"id":"eefefdca-2fbe-4430-980b-49b636cccbd7","code":"ADMIN-UAM-404-1","status":"404","title":"Unknown Resource","detail":"User with id '712020:cb2d2b70-ce94-4413-b308-51c22e2a722e' not found"}]}
※'712020:cb2d2b70-ce94-4413-b308-51c22e2a722e' is the same value in case of any users.(different from <user_account_id>)
Atlassian Cloud.
Best Regards.
Masaki Suzuki
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.