I am trying to bulk update project admin in few projects. I want to achieve this using REST API.
lets say I have around 05 projects in which I want to remove a person X, how can i do that? I tried few things but didn't get an results.
I am not sure what is role actor that the document says.
My need is : I have a jql (project in (A, B, C, D)
I wat to add/remove a person from the project admin role
Any help would be appreciated.
Let me try to help you by sharing the necessary REST APIs you need to achieve this.
Each project in Jira has its own set of roles, each has unique IDs. To get the role ID for the Project Admin role, you can fetch the roles for one of the projects.
GET /rest/api/3/project/{projectIdOrKey}/role
This will return a list of roles with their unique IDs. You need to identify the ID value for the Project Admin role.
To remove a user from the Project Admin Role you can use below REST service:
DELETE /rest/api/3/project/{projectIdOrKey}/role/{roleId}?user=username
To add a user to the Project Admin Role you can use below REST service:
POST /rest/api/3/project/{projectIdOrKey}/role/{roleId}
I hope it helps.
Appreciate the help @Tuncay Senturk
I did try this and it works.
My ask is actually to feed the ProjectId or Key from an array into rest/api/3/project/{projectIdOrKey}/role/{roleId so that I don't have to run the API multiple times.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to write a script that iterates through the projects and roles. The script can be written in either Python or Groovy in which you may retrieve project id values as an array. Likewise, roleId values that you want to add/remove a user.
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.