Marco Bettiolo
Marco Bettiolo

Reputation: 5171

TeamCity: How to get the last build metadata for each build type using the REST API

Right now to get a list of the last build for each build type I have to:

This is very inefficient as I have to make as many requests as there are buildTypes.

The REST API does not allow to specify more than one BUILD_TYPE_ID per request to the endpoint.

Is there a way to aggregate this requests? Is it possible to get the last build metadata for each buildType in one go?

I am using TeamCity 8.1.

Upvotes: 4

Views: 2006

Answers (1)

Techromancer
Techromancer

Reputation: 493

Try this:

http://teamcity.jetbrains.com/app/rest/buildTypes?locator=affectedProject:(id:TeamCityPluginsByJetBrains)&fields=buildType(id,name,builds($locator(running:false,canceled:false,count:1),build(number,status,statusText)))

Check comments on this JetBrains' ticket for further details.

Upvotes: 1

Related Questions