4

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

  • Get all the build types through this endpoint: /guestAuth/app/rest/buildTypes/
  • Get the last build metadata for each buildType: /guestAuth/app/rest/buildTypes/id:BUILD_TYPE_ID/builds/?locator=lookupLimit:1

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.

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
Marco Bettiolo
  • 5,071
  • 6
  • 30
  • 35
  • I'm not sure about getting ALL your builds in one script but you can certainly get the last successful build for each build .. `wget.exe http://teamcity.domain.com/httpAuth/repository/downloadAll/btx/.lastFinished/ --user= --password= --output-document=artifacts.7z` – wal May 27 '14 at 10:34
  • @wal To clarify, I don't want to get the artifact, I want to get the build metadata from the REST API. – Marco Bettiolo May 27 '14 at 11:46

1 Answers1

1

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.

Techromancer
  • 431
  • 4
  • 15