Forums

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

Bulk import users with project role using Rest API or any other means

rbalamu2
Contributor
August 1, 2022

Hi Team,
I wanted to check if we have any option in jira cloud to bulk import users along with project role.
I am aware that, Import users in user management will let the user to invite bulk users with their email id but it has option to map to certain group.

But, My aim was to Bulk import users with project role. I read in this article: https://community.atlassian.com/t5/Atlassian-Account-questions/Can-I-bulk-import-users-in-Atlassian-Cloud/qaq-p/919804
It says that, using rest api Atlassian support team can do it. Is it not possible to do as an admin??? 
If only your team can do it then, is it possible to map the user to project along with project role using rest api??? 

Kindly help!

Let me know if I am not clear with my question.

1 answer

1 accepted

0 votes
Answer accepted
Vikrant Yadav
Community Champion
August 2, 2022

Hi @rbalamu2  You can get the number of users in project role simply by running following URL in browser :- 

First URL gives you the number of roles in projects along with Role ID and project id.

Second URL gives you number of users added in project role. 10002 is a Administrator Project role ID. if you have Project ID and role Id you can directly use this URL.

https://xyz.atlassian.net/rest/api/2/project/PA/role
https://xyz.atlassian.net/rest/api/2/project/10000/role/10002

 

Complete Document :- https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-roles/

 

Thanks

rbalamu2
Contributor
August 2, 2022

Hi @Vikrant Yadav ,
Thanks for your reply. I think you're explaining about how I can get the users from jira (i.e export users from jira). 

but, what I want is -> I want to create users in bulk.

I want bulk import users to jira along with project role.

 

kindly suggest.

 

Thanks,

Rahini

Vikrant Yadav
Community Champion
August 2, 2022

@rbalamu2  Sorry for misunderstanding the query. 

First you have to create user via REST API then only you can add user in project role using POST.

If you want to do it in bulk , for this you need POSTMAN application. Create a variable for user email address in postman as for creating a user Email address is required , use the same variable name in csv column , put all the users email address in that column. Run Create user POST api in Postman and attach csv file. It runs for all users automatically. Same thing you can do for adding user in a project role. 

Kindly check following document for adding user in project role. Bulk addition of user in role is not mentioned in Atlassian Document that's why shared POSTMAN method. 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-post

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

rbalamu2
Contributor
August 2, 2022

Hi @Vikrant Yadav 

Thanks again. We have SSO so users will be visible in jira only after they add to our AD group.

Is there a way where we can bulk add users to project role with respect to project after the user is visible in jira?

 

Apologize if I am redirecting you.

 

Thanks,

Rahini

Vikrant Yadav
Community Champion
August 2, 2022

@rbalamu2  I am not sure any other solution available or not,  except postman rest api for bulk addition of user in a role. Via postman you can do it easily, you only to create a csv file , create variable and run the file. Postman will run api for each row.

In Atlassian document , bulk adding Actor in project role API not available. 

If you have script runner plugin installed, you can write a code and add user in Bulk.   

Thanks

rbalamu2
Contributor
August 3, 2022

Thanks @Vikrant Yadav 

Like Vikrant Yadav 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