2

I have a project in TeamCity and I am trying to update one of its inherited parameter's values, the parameter is inherited from the parent project and has a blank value.

When I PUT a new value against the API, a new parameter with the same name is created with the correct value, but the inherited parameter's value remains blank.

I am using the C# the FluentTC library to do this but I have also tried using the TeamCity REST Api directly.

var teamCity = new RemoteTc()
    .Connect(h => h
        .ToHost("teamcity")
        .AsUser("someUser", "somePassword));

 teamCity.SetProjectParameters(project => 
    project.Id("someProjectId"), buildConfig => buildConfig.Parameter("someParameter", "4"));

The documentation for the above code can be found under the "Set project parameter" here.

Any help would be greatly appreciated.

Boris Modylevsky
  • 3,029
  • 1
  • 26
  • 42
Jam
  • 296
  • 2
  • 8

1 Answers1

2

I had this problem for quite a while, which confused me because the request and response all looked good.

Eventually I found that I had edited the inherited value in the child project, which was causing the problem. It was always using the overridden value because I was accessing the parameter in the build steps of the child project.

To solve I pressed the 'reset' button against the parameter in the child project's properties, and this constant override was removed. The value turned from black to being greyed out, showing the true value of the parameter in the base project, which is the one that the REST api updates.