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.
To get a value of an existing project-level build parameter, use:
GET/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/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/app/rest/projects/<projectLocator>/parameters/<parameter>
To delete a project-level parameter, use:
DELETE/app/rest/projects/<projectLocator>/parameters/<parameter>
To get a project's name or description, use:
GET/app/rest/projects/<projectLocator>/parameters/<fieldName>
where fieldName
is either name
or description
. To update either field, use:
PUT/app/rest/projects/<projectLocator>/parameters/<fieldName>
The payload should be in the text/plain
format.
Project features include issue trackers, versioned settings, custom charts, shared resources, and third-party report tabs.
To create a new project feature, use:
POST/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="coverage.zip!index.html"/>
<property name="title" value="Code Coverage"/>
<property name="type" value="BuildReportTab"/>
</properties>
</projectFeature>
{
"type" : "ReportTab",
"properties" : {
"property" : [
{
"name" : "startPage",
"value" : "coverage.zip!index.html"
},
{
"name" : "title",
"value" : "Code Coverage"
},
{
"name" : "type",
"value" : "BuildReportTab"
},
],
}
}
To get a specific project feature, use:
GET/app/rest/projects/<projectLocator>/projectFeatures/<featureId>
To update it, PUT ProjectFeature
to the below endpoint:
PUT/app/rest/projects/<projectLocator>/projectFeatures/<featureId>
To delete a project feature, use:
DELETE/app/rest/projects/<projectLocator>/projectFeatures/<featureId>
Thanks for your feedback!