Skip to content

confluence: Confluence.get_group_members: warning if system limit is lower than set limit-param #522

Description

@T-Born

def get_group_members(self, group_name='confluence-users', start=0, limit=1000, expand=None):

Caused an issue in my case because some users where left out (only 200 users where returned).

to avoid this in future and to be independent from those system settings I did this:

        current_index = 0
        limit = 50
        usernames = []
        while 1:
            query_results = self.confluence.get_group_members(group_name=groupname,
                                                              start=current_index,
                                                              limit=limit)
            for u in query_results:
                usernames.append(u["username"])

            if len(query_results) < limit:
                break
            current_index += len(query_results)

        return usernames```

Thanks for all your work. I really appreciate it!

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