Code example bug in the readme
The Readme contains a code error that should be fixed, the list does not have an attribute .value, removing this should solve the problem
(Python 3.10.11)
Thank you for pointing out the issue in the Readme. You're right; in Python, lists do not have an attribute named .value.
Your proposed solution correctly iterates through the get_projects_response list, and by using project.name, it accesses the name attribute of each TeamProjectReference object in the list.
Here's the corrected code for clarity:
get_projects_response: List[TeamProjectReference] = core_client.get_projects()
index = 0 # Note: 'index' is declared but not used in the loop.
for project in get_projects_response:
print(project.name)
In python 3.7.3 this code also fails further on
Line 23 tries to find the continuation_token attribute of that same list and that does not work either.
In python 3.7.3 this code also fails further on
Line 23 tries to find the continuation_token attribute of that same list and that does not work either.
can you provide more details?
In python 3.7.3 this code also fails further on Line 23 tries to find the continuation_token attribute of that same list and that does not work either.
can you provide more details?
The object created with
get_projects_response = core_client.get_projects()
does not have a "continuation_token" property. Simply does not exist - it has been discussed elsewhere that this was probably quietly discontinued when the api switched from 6.x to 7.x, but I don't really know. I don't know what details I should provide - the sample code simply does not run as is and the documentation also gives no alternative way to achieve this, I don't personally need the functionality at the moment so I can't test anything further.
It appears that the issue you're encountering is related to changes in the Azure DevOps Services REST API, particularly the transition from version 6.x to 7.x. The continuation_token property, which was previously available in version 6.x, seems to have been deprecated or removed in the newer version.
As of now, the Azure DevOps Python API documentation might not have been updated to reflect this change, leading to the confusion you're experiencing. Unfortunately, without this continuation_token, it's not straightforward to implement pagination or fetch projects beyond the initial response limit set by the API.