Get the oldest commit of a specific BuildId via [Get Build Changes] API

Viewed 46

How to get the oldest commit of a specific BuildId via [Get Build Changes] API Tried to get the oldest commit from a specific build.

https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/changes?continuationToken={continuationToken}&api-version=6.0

The [Get Build Changes] API above seems to be the proper API to be used. However, it defaults to return the latest 50 commits of the build.

This made me have to send more API requests with the response header [x-microsoft-continuation] for next 50 commits until the last page to get the oldest commit of the build, which is not that efficient for my use case.

Would you please suggest if there is any easier way (less API calls) that I could use to get the oldest commit of a specific build?

Here are also one more questions : Is there any easier way to know the total number of commits for a specific build?

0 Answers
Related