from atlassian import Confluence

confluence = Confluence(
    url='http://localhost:8090',
    username='admin',
    password='admin')
# this example related get all user from group e.g. group_name
group_name = 'confluence-users'
flag = True
i = 0
limit = 50
result = []
while flag:
    response = confluence.get_group_members(group_name=group_name, start=i * limit, limit=limit)
    if response:
        i += 1
        result.append(response)

print(result)

from atlassian import Confluence

confluence = Confluence(
    url='http://localhost:8090',
    username='admin',
    password='admin')
# this example related get all user from group e.g. group_name
group_name = 'confluence-users'
flag = True
i = 0
limit = 50
result = []
while flag:
    response = confluence.get_group_members(group_name=group_name, start=i * limit, limit=limit)
    if response and len(response):
        i += 1
        result.append(response)
    else:
        flag = False
print(result)

Add other side of condition
Add other side of condition

  from atlassian import Confluence
  
  confluence = Confluence(
      url='http://localhost:8090',
      username='admin',
      password='admin')
  # this example related get all user from group e.g. group_name
  group_name = 'confluence-users'
  flag = True
  i = 0
  limit = 50
  result = []
  while flag:
      response = confluence.get_group_members(group_name=group_name, start=i * limit, limit=limit)
-     if response:
+     if response and len(response):
          i += 1
          result.append(response)
- 
+     else:
+         flag = False
  print(result)
  
Add other side of condition
## Code Before:
from atlassian import Confluence

confluence = Confluence(
    url='http://localhost:8090',
    username='admin',
    password='admin')
# this example related get all user from group e.g. group_name
group_name = 'confluence-users'
flag = True
i = 0
limit = 50
result = []
while flag:
    response = confluence.get_group_members(group_name=group_name, start=i * limit, limit=limit)
    if response:
        i += 1
        result.append(response)

print(result)

## Instruction:
Add other side of condition
## Code After:
from atlassian import Confluence

confluence = Confluence(
    url='http://localhost:8090',
    username='admin',
    password='admin')
# this example related get all user from group e.g. group_name
group_name = 'confluence-users'
flag = True
i = 0
limit = 50
result = []
while flag:
    response = confluence.get_group_members(group_name=group_name, start=i * limit, limit=limit)
    if response and len(response):
        i += 1
        result.append(response)
    else:
        flag = False
print(result)
