Getting and Setting Agent requirements using REST API

I am looking to use TeamCitySharp (or something similar) to access TeamCity via the REST API.
The current task/goal is to dynamically change the agent requirements of a build configuration before running it.
My Issue
I don't seem to be able to access the Agent Requirements for my build configuration.
I have a simple configuration that has two Agent Requirements:
     Parameter: - Condition: exists
     Parameter: - Condition: contains Windows
If I check out my build config via 'http://myTCserver:8082/httpAuth/app/rest/buildTypes/id:bt1112/' I don't see the Agent Requirements listed.
This may be valid.
However, looking at the documentation here: and the other thread here: I assumed that the following would give me my agent-requirements (which I could then use to update them): http://myTCserver:8082/httpAuth/app/rest/buildTypes/id:bt1112/agent-requirements
However, I just get the following error: Error: Field 'agent-requirements' is not supported.
I presume I am missing something. If someone could enlighten me I would be very grateful.

Comment actions Permalink

Which TeamCitty version do you use?

Comment actions Permalink

FYI: TeamCity Enterprise 6.5.5 (build 18087)

I just noticed the "Since TeamCity 7.0" note on the page under "Build Configuration And Template Settings" section.

I presume/am guessing that I am able to get this extra agent requirements information in my 6.5.5 build?

Comment actions Permalink

No, REST API is a part of common TeamCity bundle, so you'll have to upgrade the server.


Please sign in to leave a comment.