confluence.add_user_to_group is wrong
https://github.com/atlassian-api/atlassian-python-api/blob/42ed0b022ec5d13416d79f4118e655f536247d07/atlassian/confluence.py#L3062 This function is using the wrong URL and it should be a "PUT" not a "POST" see: https://docs.atlassian.com/ConfluenceServer/rest/8.2.0/#api/user/{username}/group/{groupName}-update Fix that should work:
def add_user_to_group(self, username, group_name):
"""
Add given user to a group
:param username: str - username of user to add to group
:param group_name: str - name of group to add user to
:return: Current state of the group
"""
url = f"rest/api/user/{username}/group/{group_name}"
return self.put(url)
Hi @Mauwork , first of all, thank you for your detection. please send PR
PR: https://github.com/atlassian-api/atlassian-python-api/pull/1425
Can someone point me to a place where I can add a test to cover the method ? So that the pull request can be merged ?
In the test dir there are only two test files for confluence.
Thanks, I would have guessed that somewhere all the other methods are tested, but it does not seem to be the case. So I guess for previous commits the coverage was not a necessary criterion to merge a pull request ?
Actually, it has been fixed. Sorry, forgot to follow-up.
meanwhile added remove_user_from_group method as well https://github.com/atlassian-api/atlassian-python-api/commit/9181fe134b152558d754ec2ef564027a793b3520