TeamCity 2021.1 Help

Edit Project Settings

This article contains use cases related to editing projects via TeamCity REST API:

  • Edit project-level build parameters and project name and description.

  • Update project features.

  • Archive and unarchive a project.

Manage Project-Level Build Parameters

To get a value of an existing project-level build parameter, use:

GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters/<parameterName>

By default, the call will return text/plain with the value of the parameter.

To create a parameter, use:

POST http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters

The type of the request's body is Property:

<property name="myCustomParameter" value="myCustomValue"/>
{ "name" : "myCustomParameter", "value" : "myCustomValue" }

To update a parameter, send the same body with the following PUT request:

PUT http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters/<parameter>

To delete a project-level parameter, use:

DELETE http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters/<parameter>

Update Project Name and Description

To get a project's name or description, use:

GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters/<fieldName>

where fieldName is either name or description. To update either field, use:

PUT http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters/<fieldName>

The payload should be in the text/plain format.

Create Project Feature

Project features include issue trackers, versioned settings, custom charts, shared resources, and third-party report tabs.

To create a new project feature, use:

POST http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/projectFeatures

For example, to add a new report tab, post the following ProjectFeature:

<projectFeature type="ReportTab"> <properties> <property name="startPage" value="!index.html"/> <property name="title" value="Code Coverage"/> <property name="type" value="BuildReportTab"/> </properties> </projectFeature>
{ "type" : "ReportTab", "properties" : { "property" : [ { "name" : "startPage", "value" : "!index.html" }, { "name" : "title", "value" : "Code Coverage" }, { "name" : "type", "value" : "BuildReportTab" }, ], } }

Edit Project Feature

To get a specific project feature, use:

GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/projectFeatures/<featureId>

To update it, PUT ProjectFeature to the below endpoint:

PUT http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/projectFeatures/<featureId>

To delete a project feature, use:

DELETE http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/projectFeatures/<featureId>
Last modified: 14 October 2021