4

I have a TeamCity project, in which I've set the branch specification so as to allow the build to be triggered by a variety of branches which meet the filter criteria. So far so good. Now, I'd like to generate a report, which has, for each branch detected, the status of the last build for that branch. I've tried setting the branch to 'any', thusly:

http://{{teamcityHost}}/guestAuth/app/rest/builds/?locator=branch:default:any,buildType:id:{{projectId}}

And that returns the 100 latest builds. However, it is entirely possible if branch A runs 50 times and branch B runs 50 times, that the latest run for branch C is not included. Is there any additional filter I can pass that will return only the latest build for each branch? I'd prefer not to have to hammer the server for an exhaustive last of all builds and then filter myself on the client side.

GWLlosa
  • 23,995
  • 17
  • 79
  • 116

1 Answers1

0

You can use count to specify the number of builds you want to return. count:-1 will return all builds.

So

http://{{teamcityHost}}/guestAuth/app/rest/builds/?locator=branch:default:any,buildType:id:{{projectId}},count:1000

Will return 1000 builds and

http://{{teamcityHost}}/guestAuth/app/rest/builds/?locator=branch:default:any,buildType:id:{{projectId}},count:-1

will return all builds.

Castrohenge
  • 8,525
  • 5
  • 39
  • 66