You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
provide the PAT and org name and execute the code.
The code used from the README File:
fromazure.devops.connectionimportConnectionfrommsrest.authenticationimportBasicAuthenticationimportpprint# Fill in with your personal access token and org URLpersonal_access_token='YOURPAT'organization_url='https://dev.azure.com/YOURORG'# Create a connection to the orgcredentials=BasicAuthentication('', personal_access_token)
connection=Connection(base_url=organization_url, creds=credentials)
# Get a client (the "core" client provides access to projects, teams, etc)core_client=connection.clients.get_core_client()
# Get the first page of projectsget_projects_response=core_client.get_projects()
index=0whileget_projects_responseisnotNone:
forprojectinget_projects_response.value:
pprint.pprint("["+str(index) +"] "+project.name)
index+=1ifget_projects_response.continuation_tokenisnotNoneandget_projects_response.continuation_token!="":
# Get the next page of projectsget_projects_response=core_client.get_projects(continuation_token=get_projects_response.continuation_token)
else:
# All projects have been retrievedget_projects_response=None
The Error I got:
project in get_projects_response.value:
AttributeError: 'list' object has no attribute 'value'
Suggested fix in code:
# Get a client (the "core" client provides access to projects, teams, etc)core_client=connection.clients.get_core_client()
# Get the first page of projectsget_projects_response=core_client.get_projects()
index=0forprojectinget_projects_response:
pprint.pprint("["+str(index) +"] "+project.name)
index+=1
The output:
'[0] Interns_round'
'[1] Smart_Iot_Lab'
The text was updated successfully, but these errors were encountered:
Ddhruv-IOT
added a commit
to Ddhruv-IOT/azure-devops-python-api
that referenced
this issue
Apr 15, 2024
Steps to re-produce:
provide the PAT and org name and execute the code.
The code used from the README File:
The Error I got:
Suggested fix in code:
The output:
The text was updated successfully, but these errors were encountered: