TeamCity – REST API – Last successful build

teamcityteamcity-9.1

I'm trying to get the latest successful build.

This request returns all of the successful builds for a specified buildType (as BUILDTYPE below).

/httpAuth/app/rest/builds/?locator=buildType:BUILDTYPE,status:SUCCESS

Is there a way to further filter out to get the single latest successful build of the corresponding buildType?

TeamCity Version: Professional 9.1.3 (build 37176)

Best Answer

Adding a count of 1 should work:

/httpAuth/app/rest/builds/?locator=buildType:BUILDTYPE,status:success,count:1
Related Topic