Skip to content

confluence.add_user_to_group is wrong #1422

@Mauwork

Description

@Mauwork

def add_user_to_group(self, username, group_name):

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions