I am using TeamCity 7.1. I want to get a list including the last build of each build configuration (build type) that is currently not running. I found this question: TeamCity - How do you get a list of the last finished build of each project through rest api? but the REST URI in the answer did not work for me.
<teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:failure)
seems to work and gives me all builds that succeeded after failing before.
But the opposite
<teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:success)
does not return any builds.
I know that I can get all build types, iterate though them and get the most recent finished build using
<teamcity-server>/httpAuth/app/rest/buildTypes/id:<build-type-id>/builds/running:false?count=1&start=0
("count=1&start=0" may not be necessary) but I am not really sure that what I get is really the latest build. Also this requires many REST calls for all build types. A neat solution would use only one REST call.
Any ideas?
<teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:failure)
and<teamcity-server>/httpAuth/app/rest/builds?locator=sinceBuild:(status:success)
and those are working. The second might not be working for you since you may not be having any builds after the last successful build. Then it will return 0 count. By and large at a time either of them will give you a 0 count because your last build will either be a SUCCESS or a FAILURE. – RinoTom