TeamCity: how to get the latest build metadata for each build type using the REST API

Right now, to get a list of the latest assembly for each type of assembly, I have to:

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

This is very inefficient, since I need to make as many queries as I have buildTypes.

The REST API does not allow you to specify more than one BUILD_TYPE_IDendpoint for each request.

Is there a way to fill out these requests? Is it possible to get the latest build metadata for each buildTypeat a time?

I am using TeamCity 8.1.

+4
source share
1 answer

:

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)))

JetBrains.

+1

Source: https://habr.com/ru/post/1542155/


All Articles