TeamCity REST API Reference 2021.2 Help

Get Build Status Icon

In this article, we explore methods available for build status icons.

Get Status Icon for Specific Build

To get an .svg icon (recommended approach), use:

GET http://<TeamCity Server host>:<port>/app/rest/builds/<buildLocator>/statusIcon

where buildLocator is a BuildLocator entity.

To get a .png icon, use:

GET http://<TeamCity Server host>:<port>/app/rest/builds/<buildLocator>/statusIcon.png

Get Status Icons for Multiple Builds

To get status icons of multiple builds, use the /app/rest/builds/aggregated endpoint and the strob locator dimension.

For example, to get an icon summarizing build statuses under the MyProject project, use:

GET http://<TeamCity Server host>:<port>/app/rest/builds/aggregated/strob:(buildType:(project:(id:MyProject)))/statusIcon

For an icon representing the latest builds on active branches of the MyBuildConfiguration configuration, use:

GET http://<TeamCity Server host>:<port>/app/rest/builds/aggregated/strob:(branch:(buildType:(id:MyBuildConfiguration),policy:active_history_and_active_vcs_branches),locator:(buildType:(id:MyBuildConfiguration)))/statusIcon

Get Icon for Latest Tagged Build

To fetch an icon of a MyBuildConfiguration build tagged with the MyTag tag, use:

GET http://<TeamCity Server host>:<port>/app/rest/builds/buildType:(id:MyBuildConfiguration),tag:MyTag/statusIcon

Display Build Status in GitHub Readme

If guest access is enabled on your TeamCity server, you can use the following markup to display the status of the TeamCityPluginsByJetBrains_TeamcityGoogleTagManagerPlugin_Build build configuration in your GitHub repository README:

[![Build status](https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:TeamCityPluginsByJetBrains_TeamcityGoogleTagManagerPlugin_Build)/statusIcon](https://<teamcity_server_address>/viewType.html?buildTypeId=TeamCityPluginsByJetBrains_TeamcityGoogleTagManagerPlugin_Build)

Troubleshooting

If the returned image contains the "no permission to get data" text (no-permission-to-get-data.svg), check the following:

  • The server has the guest user access enabled, and the guest user has permissions to access the build configuration referenced. OR

  • The build configuration referenced has the "enable status widget" option ON.

Last modified: 13 October 2021