I have organisation admin access. Do I need site admin role to create group in jira using rest api?
Asked by nagaraj_deva:

Hi,  

I am trying to create a group using Jira Rest API, with APP INSTALLED EVENT.  
While creating the group, api return you don't have site admin access error.  
But I have Organisation Admin access. Do I need site admin role to create group in jira using rest api?

trigger:  
- key: lifecycle-trigger  
function: lifecycle-trigger-func  
events:  
- avi:forge:installed:app  
- avi:forge:upgraded:app


Answers:
author: Hans Polder
body: [@nagaraj_deva](/t5/user/viewprofilepage/user-id/5541722) ,

As you're using Centralized User Management, I don't believe you can or should use the default **Jira** REST API's for this.

Can you try using the **Org Admin** REST APIs instead? See here: <https://developer.atlassian.com/cloud/admin/organization/rest/api-group-directory/#api-v1-orgs-orgid-directory-groups-post>

Keep in mind that you'll need **an API Key** (and not your*Jira API Token* ) to authenticate. See this page for more information: <https://support.atlassian.com/organization-administration/docs/manage-an-organization-with-the-admin-apis/>

Please let me know if this helps!

comments: author: nagaraj_deva
body: [@Hans Polder](/t5/user/viewprofilepage/user-id/5506451)   
Thanks for your response.   
GET API for groups working for me with the default REST API's.  
I could not create group only. And the same API is working inside the APP.


author: Hans Polder
body: [@nagaraj_deva](/t5/user/viewprofilepage/user-id/5541722) ,

I just re-read your other comment and do see now that you got it to work via the page in the App. In that case I would say that you should evaluate the differences between your setup and the Apps' setup to figure this out. I don't have relevant experience to share here, sorry :).

I would for sure try tinkering with the Org Admin API anyway since that should offer you other integrations as well for any future use cases.


author: Monika Rani
body: Hello [@nagaraj_deva](/t5/user/viewprofilepage/user-id/5541722) ,

Could you please let me know which user management experience you are using? Original user management OR Centralized user management? Here how to check: [Create groups \| Atlassian Support](https://support.atlassian.com/user-management/docs/create-groups/)

If you are using Original User Management, you must be in a site-admin group/role to create the group using REST API.

You can also check this doc: [The Jira Cloud platform REST API (atlassian.com)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) to know more about the operation permissions in REST API.

comments: author: nagaraj_deva
body: [@Monika Rani](/t5/user/viewprofilepage/user-id/3242808)   
Thanks for your response. I am Centralized User Management.  
And FYI, I am able to view all groups, which I have in my organization.  

Here is my scopes :  
permissions:  
scopes:  
- storage:app  
- manage:jira-project  
- manage:jira-configuration  
- read:group:jira  
- write:group:jira  
- delete:group:jira  
- read:avatar:jira  
- read:user:jira  
- read:jira-work  
- read:jira-user  
- write:jira-work  

This is the error message :

INFO 20:13:29.843 e89812d1-89f9-11ac-b898-befdab10268a {"errorMessages":\["An error occurred: com.atlassian.idp.client.exceptions.AuthorizationException: {\\"key\\":\\"forbidden\\",\\"context\\":{\\"message\\":\\"Not admin\\"}}"\],"errors":{}}


author: Monika Rani
body: [@nagaraj_deva](/t5/user/viewprofilepage/user-id/5541722) I would suggest you recheck the access because this error is clearly saying that the account you are using doesn't have admin access.


author: nagaraj_deva
body: [@Monika Rani](/t5/user/viewprofilepage/user-id/3242808)   
Thanks for your response.  
As I said earlier, I have ORG-ADMIN role.   
My doubt is, do we need SITE-ADMIN as well to create group.  

And I'm able to create group, if I call the create group REST API from the app.  
i.e. after running the app, I have page to create group. From that page I could create the GROUP.


Tags: cloud

jira-cloud