Forums

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

I need Jira REST API to get assign particular project roles to particular users

DIPAYAN GANGULY
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 3, 2023

Hi,

I need Jira rest APIs using which I can assign particular project roles to people(users). In Jira rest api documentation I could find some python method but those are assigning project roles to a set of user group. But I need to assign project roles to particular users. Please help me providing the API for that.

 

2 answers

1 vote
Vikrant Yadav
Community Champion
July 3, 2023

Hi @DIPAYAN GANGULY   Try to following api for adding user in a project role :- 

 

curl --request POST \
--url 'https://your-jira-server/rest/api/2/project/{projectIdOrKey}/role/{roleId}' \
--user 'username:password' \
--header 'Content-Type: application/json' \
--data '{
"user": ["username"]
}'

For JIRA cloud Python and cURL available here :- https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-role-actors/#api-rest-api-3-project-projectidorkey-role-id-put 

1 vote
Evgenii
Community Champion
July 3, 2023

Hi, @DIPAYAN GANGULY 

If I understood you right - you have to use this merhods:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-role-actors/#api-rest-api-3-project-projectidorkey-role-id-post

In body use parameter user, not groupId, like in example.

image.png

Suggest an answer

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

Atlassian Community Events