Unable to render embedded object: File (TeamCity48.png) not found.

TeamCity 10.x and 2017.x Documentation

Icon

You are viewing the documentation of TeamCity 10.x and 2017.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you download the artifacts from within a TeamCity build, consider using teamcity.auth.userId/teamcity.auth.password system properties as credentials for the download artifacts request: this way TeamCity will have a way to record that one build used artifacts of another and will display it on the build's Dependencies tab.

Other Build Requests

Snapshot dependencies

Since TeamCity 9.1 there is an experimental ability to retrieve entire build chain (all snapshot-dependency-linked builds) for a particular build:

http://teamcity:8111/httpAuth/app/rest/builds?locator=snapshotDependency:(to:(id:XXXX),includeInitial:true),defaultFilter:false
This gets all the snapshot dependency builds recursively for the build with id XXXX.

Build Parameters

...

Changes 

<changes>

<changes> is meant to represent changes the same way as displayed in the build's Changes in TeamCity UI. In the most cases these are the commits between the current and previous build. The <changes> tag is not included into the build by default, it has the href attribute only. If you execute the request specified in the href, you'll get the required changes.

Get the list of all of the changes included into the build: GET http://teamcity:8111/httpAuth/app/rest/builds/id:<build id>/resulting-properties

Build fields

Get single build's field: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/<field_name>  (accepts/produces text/plain) where <field_name> is one of "number", "status", "id", "branchName" and other build's bean attributes

Statistics

Get statistics for a single build: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/statistics/ only standard/bundled statistic values are listed. See also Custom Charts
Get single build statistics value: changes?locator=build:(id:<buildId>)
Get details of an individual change: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/statistics/<value_name>

Get statistics for a list of builds: GET http://teamcity:8111/httpAuth/app/rest/builds?locator=BUILDS_LOCATOR&fields=build(id,number,status,buildType(id,name,projectName),statistics(property(name,value)))

Build log

Downloading build logs via a REST request is not supported, but there is a way to download the log files described here.

Changes

The <changes> tag is not included into the build by default, it has the href attribute only. If you execute the request specified in the href, you'll get the required changeschanges/id:changeId
Get information about a changed file action : the files node lists changed files. The information about the changed file action is reported via the changeType attribute for the files listed as one of the following: added, edited, removed, copied or unchanged.

Filter all changes by a locator: GET   GET http://teamcity:8111/app/rest/changes?locator=<changeLocator>

...

<changeLocator>
Note that the change id is the change's internal id, not the revision. The id can be seen in the change node listed by the REST API or in the URL of the change details (as modId).

Get all changes for a project: GET GET http://teamcity:8111/app/rest/changes?locator=project:projectId
Get all the changes in a build configuration since a particular change identified by its id: http://teamcity:8111/httpAuth/app/rest/changes?locator=buildType:(id:buildConfigurationId),sinceChange:(id:changeId)
AnchorpendingChangependingChangeGet pending changes for a build configuration http://teamcity:8111/httpAuth/app/rest/changes?locator=buildType:(id:BUILD_CONF_ID),pending:true

Get the list of all of the changes included into the build: GET http://teamcity:8111/app/rest/changes?locator=build:(id:<buildId>)

Get details of an individual change: GET http://teamcity:8111/app/rest/changes/id:changeId
Get information about a changed file action : the files node lists changed files. Since TeamCity 10.0, the information about the changed file action is reported via the changeType attribute for the files listed as one of the following:  added, edited, removed, copied or unchanged.

lastChanges

The <lastChanges> tag <lastChanges>
The <lastChanges> tag contains information about the last commit included into the build (a single commit only). It also returns the and is only good for re-triggering the build: it contains the TeamCity internal id (the id attribute) associated with the commit. The id can be useful when running , which is necessary for TeamCity to trigger a custom build on the same commit (see the example example above ).

Revisions

<revisions>

The <revisions> tag contains revisions the same as revisions table on the build's Changes tab in TeamCity UI: it lists the revisions of all of the VCS repositories associated with this build that will be checked out by the build on the agent.  If a build does not have its own VCS roots, but has snapshot dependencies and the option "Show changes from dependencies" is turned on, <revisions> can be empty but <changes> may still be returned 
A revision might or might not correspond to a change known to TeamCity. e.g. for a newly created build configuration and a VCS root, a revision will have no corresponding change.

Get all builds with the specified revision:   http://teamcity:8111/app/rest/builds?locator=revision(version:XXXX)

<versionedSettingsRevision> 

Since TeamCity 10, <versionedSettingsRevision> is added to represent revision of the versioned settings of the build.

Snapshot dependencies

Since TeamCity 9.1 there is an experimental ability to retrieve entire build chain (all snapshot-dependency-linked builds) for a particular build:

http://teamcity:8111/httpAuth/app/rest/builds?locator=snapshotDependency:(to:(id:XXXX),includeInitial:true),defaultFilter:false
This gets all the snapshot dependency builds recursively for the build with id XXXX.

Build Parameters

Get the parameters of a build: http://teamcity:8111/httpAuth/app/rest/builds/id:<build id>/resulting-properties

Build fields

Get single build's field: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/<field_name>  (accepts/produces text/plain) where <field_name> is one of "number", "status", "id", "branchName" and other build's bean attributes

Statistics

Get statistics for a single build: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/statistics/ only standard/bundled statistic values are listed. See also Custom Charts
Get single build statistics value: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/statistics/<value_name>

Get statistics for a list of builds: GET http://teamcity:8111/httpAuth/app/rest/builds?locator=BUILDS_LOCATOR&fields=build(id,number,status,buildType(id,name,projectName),statistics(property(name,value)))

Build log

Downloading build logs via a REST request is not supported, but there is a way to download the log files described here.

Build problems

GET http://teamcity:8111/httpAuth/app/rest/problemOccurrences?locator=build:(BUILD_LOCATOR)

...