Hello Everyone,
We have seen requests from community users on managing users in bulk when
Before we get into the concept, I would like you to refer to the links which are on the feature request.
Now that we have context what are the future plans of Atlassian on the topic we are discussing.
Let's look at how we can manage users in bulk when adding or removing users for now
We have an API to create or remove users from the site. Please note these APIs are experimental meaning this may be changed or continued forward with any advancements if needed.
API to Create (Invite) Users to Site
API Here
curl --request POST \
--url 'https://your-site.atlassian.net/rest/api/3/user' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"emailAddress": "username@company.com", "displayName": "Username", "name": ""}'
API to Delete (Remove) Users from Site
API Here
curl --request DELETE \
--url 'https://your-site.atlassian.net/rest/api/3/user?accountId=5d36b583beedf60c26aa372d' \
--user 'email@example.com:<api_token>'
The difference between deleting the user via API and deleting the user via UI is that you cannot remove the user from the site if the user is assigned an issue, reporter of an issue, project lead, component lead.
In this case, you can choose to remove the user from default groups from your site for each product.
API Here
curl --request DELETE \
--url 'https://your-site.atlassian.net/rest/api/3/group/user?groupname={groupname}&accountId=5b10ac8d82e05b22cc7d4ef5' \
--user 'email@example.com:<api_token>'
How to get account IDs - Using the export option in Directory.
How to get default groups - If you navigate to the product section, it lists down the groups which are part of the product and default group as well.
Here's a link to a helpful article on how to bulk remove the users from the site using an add-on.
There are two add-ons as of now in the cloud to manage users in bulk (One here and another here) You could consider this as an alternative till the functionality in the cloud is released or you could write the script to manage users for inviting them over to the site or removing them.
If you need to get started with APIs, here's a link to start your journey.
Let us know in the comments if you have any thoughts or how you are managing the tasks when it comes to bulk managing the users.
Thanks,
Pramodh
Pramodh M
DevSecOps Consultant
DevTools
Bengaluru
663 accepted answers
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
3 comments