Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8402891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:11:39+00:00 2026-06-09T22:11:39+00:00

I use the TeamCity (7.0) REST API to allow developers to trigger custom builds.

  • 0

I use the TeamCity (7.0) REST API to allow developers to trigger custom builds. I add the build to the queue like this:

http://teamcity/httpAuth/action.html?add2Queue=%5BbuildTypeId%5D&name=%5BpropName%5D&value=%5BpropValue%5D

My question is how I best can track the progress of the build just triggered. The REST call does not return any info about build ID assigned to the build, so even if I poll the list of builds (running/finished) I will not know if one of them is the one I triggered. There could potentially be several builds for the same buildTypeId in the queue, so I need a way to separate out the one I am after.

I read somewhere a suggestion that you could add a build property with a unique value to each build you put in the queue, and then later poll the build list and look for one with that exact property value. I have however not found a way of listing the properties for the builds, so I am still stuck. This REST call does not provide information about properties:

http://teamcity/httpAuth/app/rest/builds/?locator=buildType:%5BbuildTypeId%5D

Any suggestions on how to solve this? I would ideally like to know if the build is in the queue, if it is running, and when it’s done I would like to get the status. The most important is however to know if it is done and what the status has.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:11:51+00:00Added an answer on June 9, 2026 at 10:11 pm

    After some further investigation I came up with a solution for this which seems to work fine:

    I found out that even though you did not get any information about the custom build properties using the “/builds/?locator=buildType:x” call, you could extract the build ID for each one of the builds in that list and then do another REST call to get more details about one specific build. The rest call looks like this:

    http://teamcity/httpAuth/app/rest/builds/id:{0}
    

    The response from this call will give you a “build object” which contains a list of build properties, among other things.

    My solution for tracking the build progress was then like this:

    When a build is added to the TeamCity queue, I first add a property to the URL called “BuildIdentifier”. The value is just a GUID. I pass this identifier back to the client application, and then the client starts polling the server, asking for the status of the build with this specific identifier. The server then goes through some steps to identify the current stage of the build:

    1: Check if the build is running. I get the list of running builds with the call “/builds?locator=running:true”, iterate through the builds and use the build ID to query the REST API for details. I then go through the details for each running build looking for a build with a matching “BuildIdentifier” property to the one I received from the client. If there is a match in one of the running builds I send a response with a message that the build is running at x percent (PercentageComplete property of the build object) to the client who is tracking the progress. If a match is not found I move on to step 2.

    2: Check if it is finished: First get the latest build list using the “/builds/?locator=buildType:x” call. Then do the same thing as in step 1, and extract the X latest builds from the list (I chose 5). In order to limit the number of REST calls I set an assumption that the build would be in the latest 5 builds if it was finished. I then look for a match on the BuildIdentifier, and if I get one I return the status of the build (FAILED, SUCCESS, etc.).

    3: If there was no match for the BuildIdentifier in step 1 or 2 I can assume that the build is in the queue, so I return that as the current status.

    On the client side I poll the server for the status every x seconds as long as the status is saying that the build is either in the queue, or running.

    Hope this solution could be helpful if there are someone else with the same problem out there! I would think that tracking the progress of a triggered build is a pretty common task if you use the TeamCity REST API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to use the TeamCity REST API to find out which
As per Teamcity REST API We can use the following to get XML Data
I've been trying to use TeamCity 4.5 in order to automate builds of an
I've set up TeamCity on a Linux (Ubuntu) box and would like to use
I use teamcity to build Sharepoint projects using 64-bit MSBuild. All projects work fine
My Goal: use webdeploy to deploy builds from TeamCity to remote IIS server I
I use TeamCity for continious integration. Solution checkouts on deploy machine and builds. Deploy
Basically I'd like to use the NUnit plugin for TeamCity (the program, not necessarily
I would like to pull artifacts from teamcity. I've been trying to use c#
I use TeamCity to build c++ on Unix (Solaris). TeamCity invokes make, and within

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.