"Actual Parameters on Agent" with REST API

Hi there,

how can I retrieve parameters that were set e.g. by a build script via the REST API?
I can see them in the web interface under section "Actual Parameters on Agent".

Thanks in advance,

Comment actions Permalink

Hi Alexander,

Where do ou want to retrieve them? In a build? In a TeamCity agent plugin?

System proprties and environment variables are passed to the build script. Configuration parameters can be used as a reference in an environment variable.
Also, all them can be read from the files on agent during the build (see value of system.teamcity.build.properties.file env.TEAMCITY_BUILD_PROPERTIES_FILE )

Comment actions Permalink

I want to read them with the REST API.

E.g.: GET .../TeamCity/httpAuth/app/rest/buildTypes/bt97/builds/id:619 gives me


     <property name="propertyxyz" value=""/>


This Property is set during the build in a build script (to 'valuexyz' for example). I would expect to find the final value at this URL, but it's empty.

Is there a way to get around this? We have TeamCity 7.0 installed.


Comment actions Permalink


Try GET .../TeamCity/httpAuth/app/rest/buildTypes/bt97/builds/id:619/resulting-properties
However, this request might change in the next versions of TeamCity.

Comment actions Permalink

I'm SO glad I saw this post. I was trying to figure out how to parse the html on the page to get at the resulting properties.

That said, besides reading the API source code, how could I have discovered this from the API itself?

Comment actions Permalink


http://.../app/rest/application.wadl produces the most up-to-date and complete list of URLs supported (as it is generated from the actual code).

Comment actions Permalink

I still do not see the resulting parameters/app/rest/buildTypes/btype/builds/id:1234 or via /app/rest/builds/id:1234.

I only see the parameters that are defined before execution, the actual parameters on the agent as shown in the parameters tab do not seem to be available?

Comment actions Permalink

Just for future scavengers...
This information is not available from the rest api.  You can get it from the hidden ".teamcity/properties/build.finish.properties.gz" file on each build.

specifically something like this:

returns a gzipped java properties file.


Comment actions Permalink

Not sure why resulting-properties added to the end of the rest call didn't work for Dave Horner but appears to me to be working in local testing.

In fact appears to be documented here: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-BuildParameters


Please sign in to leave a comment.