"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,


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 )


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.




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


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?



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).


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?


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.



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


I was having the same problem as Dave Horner, just to be clear:

.../TeamCity/httpAuth/app/rest/buildTypes/bt97/builds/id:619/resulting-properties - does NOT work

.../TeamCity/httpAuth/app/rest/builds/id:619/resulting-properties - WORKS


Please sign in to leave a comment.