Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

nagaraj_deva
Contributor
July 13, 2024

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

2 answers

1 vote
Hans Polder _Devoteam_
Community Champion
July 15, 2024

@nagaraj_deva ,

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!

nagaraj_deva
Contributor
July 15, 2024

@Hans Polder _Devoteam_ 
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.

Like Dave Rosenlund _Trundl_ likes this
Hans Polder _Devoteam_
Community Champion
July 15, 2024

 @nagaraj_deva ,

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. 

Like # people like this
1 vote
Monika Rani
Community Champion
July 14, 2024

Hello @nagaraj_deva ,

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

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) to know more about the operation permissions in REST API.

 

 

nagaraj_deva
Contributor
July 14, 2024

@Monika Rani 
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":{}}

Monika Rani
Community Champion
July 14, 2024

@nagaraj_deva  I would suggest you recheck the access because this error is clearly saying that the account you are using doesn't have admin access. 

Like Dave Rosenlund _Trundl_ likes this
nagaraj_deva
Contributor
July 14, 2024

@Monika Rani 
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.

Like Dave Rosenlund _Trundl_ likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events