How do I change the spec of a build configuration parameter via the api?

So I have a parameter in my build configuration that is inherited from a template. It is called target_branch.
I can see a listing of it by using: GET http:/myteamcityurl/httpAuth/app/rest/buildTypes/id:buildconfig_QaDeploy/parameters/env.target_branch

which gives me the following data:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<property name="env.target_branch" value="" own="true">
    <type rawValue="select data_2='b' data_1='a' display='normal' data_4='d' data_3='c'"/>

If I change it to a PUT and add something it goes into the empty value bracket. I need to be able to change the options in the select drop down box and add branches 'e', 'f' and 'g'. I am ok with having to delete the param first and re-creating it as long as I can do it through the API.

Can anyone tell me how to do this?

1 comment
Comment actions Permalink

ok so the trick is to use PUT and remove the parameter name from the url.
then send the whole block as xml which overwrites the paramter with the new specification values.


Please sign in to leave a comment.