1
votes

I am using the below API call for retrieving all the CouldTests, but it is returning only 100 records. How can retrieve all the records?.

$uri = https://{instance}/{collection}/{project}/_apis/test/runs?minLastUpdatedDate=2020-01-28&maxLastUpdatedDate=2020-01-29&releaseIds=123456&$top=2000 $TestRuns = Invoke-RestMethod -Uri $uri
-Headers $headers

Any help is appreciated. Thanks in advance

For more about the above Link please refer.:https://docs.microsoft.com/en-us/rest/api/azure/devops/test/runs/query?view=azure-devops-server-rest-5.0

2

2 Answers

1
votes

See the continuationToken portion of that doc link that you reference. Basically, if the response contains a continuationToken, then you have to call the API again and pass in that continuationToken, repeating until there is no more continuationToken in the response.

This is common across most Azure APIs, although sometimes the naming is different such as nextLink.

0
votes

Used Invoke-WebRequest instead of Invoke-RestMethod and it is working.