Mohammad Nadeem
Mohammad Nadeem

Reputation: 9392

Teamcity REST API: How to get agent of last successful build

Is there a way in Teamcity REST API to get the agent name of the last successful build. I am using Teamcity 8.0.6. I tried this

http://<TeamcityServer>/httpAuth/app/rest/buildTypes/id:BuildId/builds?status=SUCCESS

But the result returned doesn't contain Agent name.

Upvotes: 2

Views: 1943

Answers (1)

SteveChapman
SteveChapman

Reputation: 3081

The following will give you the last successful build details for a given build type (where BUILDTYPE is the btxxx id):

http://<TeamcityServer>/httpAuth/app/rest/builds/buildType:(id:BUILDTYPE),status:SUCCESS

The response contains the agent details in the /build/agent element.

Upvotes: 3

Related Questions