Patch User groups with SDK

Hello, I am attempting to use the patch user to update a users groups but even though it runs successfully it I cannot seem to add groups to the user. I tried not changing groups and simply updating the email, which works with out any issues. But for some reason I cant seem to get the groups to update.

        body = PureCloudPlatformClientV2.UpdateUser()
        body.groups = source_user.groups
        body.version = receiving_user.version
        patch_user = users_api.patch_user(receiving_user_id, body=body)

I'm attempting to write something that will copy groups from one user and apply it to the second. I have tried using the information that comes back from a usersapi.get_user SDK call with expanded groups, as well as taking the id's from that call and getting a group listing with the groupsapi.get_groups SDK call.

The patch call returns successfully and updates the user version but has no effect on the users groups.

You can verify that the request contains the data you think it does by logging your body variable as json. If the request looks as you expect, containing the correct group information, please open a case with Genesys Cloud Care to investigate the apparent silent failure to update the groups.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.