user5855178
user5855178

Reputation: 715

TFS 2017 Web API - how to get the name of Build Agent?

I am trying to get the name of the agent that executed a given build from the TFS Web API.

There is a LOT of great details in there, but the Agent that ran the build does not seem to be in there. This is a surprise to me.

Upvotes: 0

Views: 269

Answers (1)

Pero P.
Pero P.

Reputation: 26982

You have to go to the timeline of the build:

https://learn.microsoft.com/en-us/rest/api/vsts/build/timeline/get?view=vsts-rest-4.1

This will return a Timeline, which has an array of TimelineRecords. The workerName of the timeline records contains the name of the agent running the operation.

Upvotes: 1

Related Questions