Build status parameter

I may be overlooking a built in parameter.. I'm trying to send the build status as a parameter to a console application. The console application is a build step that needs to run even if previous steps have failed. If previous steps failed it will do one thing, and if the previous steps are successful it will do another.

I have the console app set up to take a build status parameter, but I'm not finding a built in build status parameter to use (Success/Failure). Am I missing something easy? How can I access the build status?

Thanks!

4 comments
Comment actions Permalink

Hi,

No, there is no build parameter which indicate build status. To get build status please use REST API request like this %teamcity.serverUrl%/httpAuth/app/rest/builds/id:%teamcity.build.id%/status.
We also have a related feature request. Please watch/vote for it.

0
Comment actions Permalink

When getting the status of the build from the REST API, if the build is not complete yet, will it still say "FAIL" if a previous step has failed? Also can I expect the result to be "SUCCESS" if all previous steps were successful even though the build has not completed?

Thanks for you help!

0
Comment actions Permalink

The returned status will be the same as the build state (color) in UI. So if one of the steps has failed then REST API request will return FAILURE status. If build is still running and there were no failed steps then the returned status will be SUCCESS.

0
Comment actions Permalink

while setting up a webhook to provide feedback on a build status to github deployments I've found that the param `buildResult` actually gives me more usable information than `buildStatus`. (There still is some mapping required between the different states Teamcity provides and what the github API accepts however.)

0

Please sign in to leave a comment.