Then, I tried to use a method which I learned about from @Ulanbek (for bulk updating passwords)
So I Used the Postman app to get the list of users for a specific region with userGroup field:
https://{{URL}}/api/users.json?paging=false &filter=organisationUnits.path:like:UCh8L8MFPQr&fields=,sharing,userCredentials[,!access,!lastUpdatedBy,!sharing],userGroups
Then I used find and replace function to update all users with user group IDs,
like this:
Then I saved the updated Json file and tried to use import/export APP:
Hi @Ulanbek ,
Could you please give me an example of how to get all attributes from users for a specific region? Import/export app gives me all users of the system.
When I try to use the GET request in the postman (e.g. https://{{URL}}/api/users.json?paging=false &filter=organisationUnits.path:like:UCh8L8MFPQr), It returns me only the list of Display Names and IDs.
In the user creation payload, user groups are only supported when importing or POSTing a single user at a time. If you attempt to create more than one user while specifiying user groups, you will not recieve an error and the users will be created but no user groups will be assigned. This is by design and is limited because of the many-to-many relationship between users and user groups whereby user groups is the owner of the relationship. To update or create mulitple users and their user groups, consider a program to POST one at a time, or POST all users followed by another action to update their user groups while specifiying the new user’s identifiers.