I have the following json:
[{'errors': [],
'configErrors': [],
'summary': {'pullrequest': {'overall': {'count': 0,
'lastUpdated': None,
'stateCount': 0,
'state': 'OPEN',
'open': True},
'byInstanceType': {}},
'build': {'overall': {'count': 0,
'lastUpdated': None,
'failedBuildCount': 0,
'successfulBuildCount': 0,
'unknownBuildCount': 0},
'byInstanceType': {}},
'review': {'overall': {'count': 0,
'lastUpdated': None,
'stateCount': 0,
'state': None,
'dueDate': None,
'overDue': False,
'completed': False},
'byInstanceType': {}},
'deployment-environment': {'overall': {'count': 0,
'lastUpdated': None,
'topEnvironments': [],
'showProjects': False,
'successfulCount': 0},
'byInstanceType': {}},
'repository': {'overall': {'count': 0, 'lastUpdated': None},
'byInstanceType': {}},
'branch': {'overall': {'count': 0, 'lastUpdated': None},
'byInstanceType': {}}}}
I need to retrieve value count. I've tried with a loop for:
for item in json['summary']['pullreqest']['overall']:
value = item['count']
but I have an error must be integers or slices, not str .