TeamCity 8.1.2 REST API: Get the running build of the specified build configuration

350 Views Asked by At

I'm using TeamCity 8.1.2 REST API and I want to check if there is a running build in my build configuration.

To get builds in a queue I can use the following request:

> http://<tc_address>/app/rest/latest/buildQueue/?locator=buildType:<my_buildTypeId>

It returns the builds in the queue but not the running one.

Accroding to documentation https://confluence.jetbrains.com/display/TCD8/REST+API to get running builds this request can be used:

> http://<tc_address>/app/rest/builds/?locator=buildType:<my_buildTypeId>,running:true

But it returns no builds. I tried

http://<tc_address>/app/rest/builds/?locator=running:true

which returns running builds from other build configuration but the running build from my build configuration is not listed.

1

There are 1 best solutions below

2
Nirav Mistry On

Your API call is correct but seems like you are missing some configuration.

Check below setting for the given issue :

-> Go to Build Configuration

    -> Edit Configuration Settings

        -> General Settings

            -> Build options

                -> Enable status widget [Check this checkbox]

after that check API call