Get Build Status Icon
In this article, we explore methods available for build status icons (such as or ).
To get an .svg
icon (recommended approach), use:
GET/app/rest/builds/<buildLocator>/statusIcon
where buildLocator
is a BuildLocator entity.
To get a .png
icon, use:
GET/app/rest/builds/<buildLocator>/statusIcon.png
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/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/app/rest/builds/aggregated/strob:(branch:(buildType:(id:MyBuildConfiguration),policy:active_history_and_active_vcs_branches),locator:(buildType:(id:MyBuildConfiguration)))/statusIcon
To fetch an icon of a MyBuildConfiguration
build tagged with the MyTag
tag, use:
GET/app/rest/builds/buildType:(id:MyBuildConfiguration),tag:MyTag/statusIcon
To get a status icon of a MyBuildConfiguration
build run on the MyBranch
branch, use:
GET/app/rest/builds/buildType:(id:MyBuildConfiguration),branch:MyBranch/statusIcon
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)
If the returned image contains the "no permission to get data" text (), 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.