Using REST API to find dependant build




I was planning to use REST API to find check-in owner of chained build and get their email id. Is there anyone who implemented these kind of situation using REST.

Can i use REST API in a build step. I am planning to use REST to get all details after execution is completed.

Eg : I have a scenario : 

If Smoketest1 is the build which was triggered due to dependency with Devbuild1, then i need to know whose checkin caused trigger for Devbuild1 and their email.

Any help appreciated.





Hello Vishnu,

You can get the usernames of users who committed into the Devbuild1 build using REST API. For example, you can get the build details of the build by it's id stored in %dep.<buildTypeID> parameter using:


And then iterate through the list of changes, e.g.


Also using REST API you can get user's email within TeamCity build:
Another option is to enable "Show changes from snapshot dependencies" option and configure notification rules for "Builds affected by my changes". It this case if build fails the user who committed into Devbuild1 will be notified.


Hi Alina,

Thanks for your reply.

But what if multiple people committed to Devbuild. Can we get that as well using this above method.





Sorry, I corrected the answer above.


Hi Alina,


Thanks for the answer. However for reading the xml, we have to download first right. And i need credentails for that. So i have to hardcode my username and password.

Any method for reading xml without credentials? I tried below steps. But was not working. 

 $user = "%system.teamcity.auth.userId%"
$pass= "%system.teamcity.auth.password%"

Any suggestions?


Hi Vishnu,

There several options:

  1. Enable guest authentication: include "guestAuth" before the "/app/rest" part: e.g.: http://teamcity:8111/guestAuth/app/rest/builds
  2. If you perform a request from TeamCity build, you can use %teamcity.auth.userId%/%teamcity.auth.password% system properties as credentials.

For more details see the section.


Please sign in to leave a comment.