Take the 2-minute tour ×

I have some integration tests that get kicked off by TeamCity on a successful build. I have had success using the TeamCity REST API in order to tag the build as passed or failed, but would actually like to mark the build status as passed or failed (in the same way builds are failed due to compilation or unit test failures).

The documentation for the REST API is pretty sparse. Is it just not possible to do this through the REST API or is it undocumented?


Current process is as follows:

"App" TC Build configuration actually builds the application and runs the unit tests.

"Test" TC Build configuration depends on "App" configuration completing successfully. If "App" builds successfully (no compile or unit test failures), "Test" configuration kicks off, which pulls down the build artifacts and runs the live integration tests on the application. Prior to these tests being run, "App" configuration has a status of passing, since it compiled successfully and there were no unit test failures.

What I am trying to do is to change "App" config status to failed, if the "Test" configuration failed. Currently I am merely tagging "App" as passed or failed, but the actual build status is always passing. Essentially I am trying to get the change log or history to show the red X icon for a failed build, rather than the green check mark.

"App" and "Test" are 2 separate TeamCity build configurations. Since they are separate, Build Script Interaction, as suggested by @sharma, will not do the trick, since Build Script Interaction can be used to fail/update the currently running build configuration, whereas I am trying to update/fail a separate and already completed build configuration.

Why do we have 2 separate configs and not just run the tests from the main build? Speed of course! The integration tests take up to 10 minutes to run, and we don't want to slow down the compile cycle just because the integration tests are running.

share|improve this question

2 Answers 2

You should be able to do it through build Interaction scripts.

UPDATE: Look here, It should have "reporting messages for build logs". If you have following message printed to console in which ever application build you are running. The teamcity build will fail and show as error. If you change status to Failure it will still fail. You have more information on the link I provided. An example message you may want to printout:


Look at this

share|improve this answer
I'm not sure if this quite meets my needs, but I will check it out. It looks like the build interaction scripts are to be used within the current build process, to customize passing/failing the currently running build, but not an external build. –  Tom E Mar 17 '11 at 14:40
@Tom E - I have updated a link that you can report to build log and fail your build from a script out side teamcity –  remo Mar 17 '11 at 17:11
thanks for the update, and that's more good information, but it does not do what I am trying to do. –  Tom E Mar 17 '11 at 19:53
@TOM E- I read you have updated. Instead of failing the previous build you may want to PIN the build instead as an alternative.I dont think what you want is possible - "Failing the build config after it has passed", if I am right! –  remo Mar 17 '11 at 20:38
up vote 0 down vote accepted

So the answer to my original question, is it possible to use REST API to mark build as failed from another build configuration, is that it is not possible.

Per TeamCity support: There is no way to change a build status after it has been finished. This is not a limitation of REST API, this is just not implemented feature of TeamCity. Here is a related feature request in our tracker: http://youtrack.jetbrains.net/issue/TW-2529

(I upvoted @sharma's answer and comments, as they were definitely informative, but ultimately not a solution to my problem.)

share|improve this answer
just an idea if you have the second build config as a build step, that mite solve ur problem temporarily. –  remo Mar 21 '11 at 12:47

Your Answer


