REST API - Get all build configurations status by the change commit SHA

I want to know that for a commit SHA, how many build configurations have been deployed with the change and how many are still remaining?

There is ChangeStatus, but I don't see any documentation on how to get it, and also, it doesn't return the exact build config IDs with the status. I do see for a change, TeamCity UI shows the build status, so there should be a way to retrieve it through the API as well.

0
2 comments

Hello,

You could probably get all the information using a call like this

TEAMCITYSERVER/app/rest/builds?locator=defaultFilter:false,revision:af05454e1f431c718f6613531ddeb082d333eafd&fields=build(*)

You could then iterate through the resulting list to extract the needed information. You could also limit the results by using the locator dimensions count, lookup limit and also limit the number of fields ("fields=build(*)" will output all the possible fields for the build).

Let me know if this works for you or if you have any questions.

Thank you,

Guilherme

0

Thanks, Guilherme for looking into it! I don't think "revision" will work here as the build configuration might have been deployed with 5 commit SHAs, but the "revision" will only be the topmost commit SHA, against which the build configuration ran. And if I am trying to search for builds with older commit SHA as revision, it won't show the above run. Is my understanding incorrect?

 

Thank you,

Amit

0

Please sign in to leave a comment.