TeamCity 2021.1 Help

Manage Investigations

This article lists REST API requests concerning investigations.

List Investigations

To get a list of all investigations on the server, use:

GET http://<TeamCity Server host>:<port>/app/rest/investigations

The request responds with Investigations which contains instances of an Investigation entity.

To get specific investigations, use:

GET http://<TeamCity Server host>:<port>/app/rest/investigations/<investigationLocator>

investigationLocator is typed as InvestigationLocator. For example, to get investigations for a test named MyTest, use:

GET http://<TeamCity Server host>:<port>/app/rest/investigations?locator=test:(name:MyTest)

To find investigations assigned to the MyUser user, use:

GET http://<TeamCity Server host>:<port>/app/rest/investigations?locator=assignee:(username:MyUser)

To find all investigations related to a given build type, use:

GET http://<TeamCity Server host>:<port>/app/rest/investigations?locator=buildType:(id:MyBuildConfigurationID)

Assign/Replace Investigations

To assign a single investigation, POST Investigation to:

POST http://<TeamCity Server host>:<port>/app/rest/investigations

Example payload:

<investigation state="TAKEN"> <assignee username="MyUsername"/> <scope><buildType id="MyBuildConfigurationID"/></scope> <target anyProblem="true"/> <resolution type="whenFixed"/> </investigation>
{ "scope" : { "buildType" : { "id" : "MyBuildConfigurationID" } }, "state" : "TAKEN", "assignee" : { "username" : "MyUsername" }, "resolution" : { "type" : "whenFixed" }, "target" : { "anyProblem" : true } }

To update an existing investigation, PUT an Investigation entity to:

PUT http://<TeamCity Server host>:<port>/app/rest/investigations/<investigationLocator>

To create multiple investigations with a single request, POST (or PUT) an Investigations entity to:

POST http://<TeamCity Server host>:<port>/app/rest/investigations/multiple

Example payload:

<investigations> <investigation>investigation description as per above example...</investigation> <investigation>investigation description as per above example...</investigation> <investigation>investigation description as per above example...</investigation> </investigations>
{ "investigation" : [ { investigation description as per above example... }, { investigation description as per above example... }... ] }

Delete Investigation

To delete an investigation, use:

DELETE http://<TeamCity Server host>:<port>/app/rest/investigations/<investigationLocator>
Last modified: 14 October 2021