Runs - Update

Update test run by its ID.

PATCH https://dev.azure.com/{organization}/{project}/_apis/test/runs/{runId}?api-version=5.0

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

project
path True

string

Project ID or project name

runId
path True

integer

int32

ID of the run to update.

api-version
query True

string

Version of the API to use. This should be set to '5.0' to use this version of the api.

Request Body

Name Type Description
build

ShallowReference

An abstracted reference to the build that it belongs.

buildDropLocation

string

buildFlavor

string

buildPlatform

string

comment

string

Comments entered by those analyzing the run.

completedDate

string

Completed date time of the run.

controller

string

Name of the test controller used for automated run.

deleteInProgressResults

boolean

dtlAutEnvironment

ShallowReference

An abstracted reference to DtlAutEnvironment.

dtlEnvironment

ShallowReference

An abstracted reference to DtlEnvironment.

dtlEnvironmentDetails

DtlEnvironmentDetails

This is a temporary class to provide the details for the test run environment.

dueDate

string

Due date and time for test run.

errorMessage

string

Error message associated with the run.

iteration

string

The iteration in which to create the run.

logEntries

TestMessageLogDetails[]

Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ...

name

string

Name of the test run.

releaseEnvironmentUri

string

releaseUri

string

sourceWorkflow

string

startedDate

string

Start date time of the run.

state

string

The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting

substate

TestRunSubstate

testEnvironmentId

string

testSettings

ShallowReference

An abstracted reference to test setting resource.

Responses

Name Type Description
200 OK

TestRun

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.test_write Grants the ability to read, create, and update test plans, cases, results and other test management related artifacts.

Examples

General example
Updating due date
Updating run comment
Updating started date

General example

Sample Request

PATCH https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/runs/1?api-version=5.0

{
  "name": "NewTestRun2",
  "comment": "This test run is doomed"
}

Sample Response

{
  "id": 1,
  "name": "NewTestRun2",
  "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Runs/1",
  "isAutomated": false,
  "iteration": "Fabrikam-Fiber-TFVC\\Release 1\\Sprint 1",
  "owner": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "project": {
    "id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
    "name": "Fabrikam-Fiber-TFVC",
    "url": "https://dev.azure.com/fabrikam/_apis/projects/Fabrikam-Fiber-TFVC"
  },
  "startedDate": "2014-05-05T00:00:00Z",
  "completedDate": "2014-05-10T00:00:00Z",
  "state": "Completed",
  "plan": {
    "id": "60",
    "name": "sprint1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/60"
  },
  "postProcessState": "Complete",
  "dueDate": "2014-05-07T00:00:00Z",
  "totalTests": 1,
  "passedTests": 1,
  "createdDate": "2014-05-04T12:50:31.38Z",
  "lastUpdatedDate": "2014-10-07T22:19:01.557Z",
  "lastUpdatedBy": {
    "id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabrikamfiber3@hotmail.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d"
  },
  "revision": 24,
  "comment": "This test run is doomed"
}

Updating due date

Sample Request

PATCH https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/runs/1?api-version=5.0

{
  "dueDate": "2014-05-07"
}

Sample Response

{
  "id": 1,
  "name": "NewTestRun2",
  "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Runs/1",
  "isAutomated": false,
  "iteration": "Fabrikam-Fiber-TFVC\\Release 1\\Sprint 1",
  "owner": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "project": {
    "id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
    "name": "Fabrikam-Fiber-TFVC",
    "url": "https://dev.azure.com/fabrikam/_apis/projects/Fabrikam-Fiber-TFVC"
  },
  "startedDate": "2014-05-04T12:50:33.17Z",
  "completedDate": "2014-05-04T12:50:31.953Z",
  "state": "Completed",
  "plan": {
    "id": "1",
    "name": "sprint1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1"
  },
  "postProcessState": "Complete",
  "dueDate": "2014-05-07T00:00:00Z",
  "totalTests": 1,
  "passedTests": 1,
  "createdDate": "2014-05-04T12:50:31.38Z",
  "lastUpdatedDate": "2014-05-06T15:54:46.697Z",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "revision": 6,
  "comment": "This test run is doomed"
}

Updating run comment

Sample Request

PATCH https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/runs/1?api-version=5.0

{
  "comment": "This test run is doomed"
}

Sample Response

{
  "id": 1,
  "name": "NewTestRun2",
  "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Runs/1",
  "isAutomated": false,
  "iteration": "Fabrikam-Fiber-TFVC\\Release 1\\Sprint 1",
  "owner": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "project": {
    "id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
    "name": "Fabrikam-Fiber-TFVC",
    "url": "https://dev.azure.com/fabrikam/_apis/projects/Fabrikam-Fiber-TFVC"
  },
  "startedDate": "2014-05-05T00:00:00Z",
  "completedDate": "2014-05-10T00:00:00Z",
  "state": "Completed",
  "plan": {
    "id": "1",
    "name": "sprint1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1"
  },
  "postProcessState": "Complete",
  "dueDate": "2014-05-07T00:00:00Z",
  "totalTests": 1,
  "passedTests": 1,
  "createdDate": "2014-05-04T12:50:31.38Z",
  "lastUpdatedDate": "2014-05-06T15:54:56.327Z",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "revision": 9,
  "comment": "This test run is doomed"
}

Updating started date

Sample Request

PATCH https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/runs/{runId}?api-version=5.0

{
  "startedDate": "2014-05-05"
}

Sample Response

{
  "id": 1,
  "name": "NewTestRun2",
  "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Runs/1",
  "isAutomated": false,
  "iteration": "Fabrikam-Fiber-TFVC\\Release 1\\Sprint 1",
  "owner": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "project": {
    "id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
    "name": "Fabrikam-Fiber-TFVC",
    "url": "https://dev.azure.com/fabrikam/_apis/projects/Fabrikam-Fiber-TFVC"
  },
  "startedDate": "2014-05-05T00:00:00Z",
  "completedDate": "2014-05-04T12:50:31.953Z",
  "state": "Completed",
  "plan": {
    "id": "1",
    "name": "sprint1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1"
  },
  "postProcessState": "Complete",
  "dueDate": "2014-05-07T00:00:00Z",
  "totalTests": 1,
  "passedTests": 1,
  "createdDate": "2014-05-04T12:50:31.38Z",
  "lastUpdatedDate": "2014-05-06T15:54:50.353Z",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "revision": 7,
  "comment": "This test run is doomed"
}

Definitions

Name Description
BuildConfiguration
CustomTestField

A custom field information.

DtlEnvironmentDetails

This is a temporary class to provide the details for the test run environment.

IdentityRef
ReferenceLinks

The class to represent a collection of REST reference links.

ReleaseReference

Reference to a release.

RunFilter

This class is used to provide the filters used for discovery

RunStatistic

Test run statistics.

RunUpdateModel
ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

TestEnvironment
TestMessageLogDetails

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

TestResolutionState
TestRun

Test run details.

TestRunSubstate

BuildConfiguration

Name Type Description
branchName

string

buildDefinitionId

integer

buildSystem

string

creationDate

string

flavor

string

id

integer

number

string

platform

string

project

ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

repositoryGuid

string

repositoryType

string

sourceVersion

string

uri

string

CustomTestField

A custom field information.

Name Type Description
fieldName

string

Field Name.

value

object

Field value.

DtlEnvironmentDetails

This is a temporary class to provide the details for the test run environment.

Name Type Description
csmContent

string

csmParameters

string

subscriptionName

string

IdentityRef

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor

string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

directoryAlias

string

displayName

string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

isDeletedInOrigin

boolean

profileUrl

string

uniqueName

string

url

string

This url is the full route to the source resource of this graph subject.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

ReleaseReference

Reference to a release.

Name Type Description
attempt

integer

creationDate

string

definitionId

integer

Release definition ID.

environmentCreationDate

string

environmentDefinitionId

integer

Release environment definition ID.

environmentDefinitionName

string

Release environment definition name.

environmentId

integer

Release environment ID.

environmentName

string

Release environment name.

id

integer

Release ID.

name

string

Release name.

RunFilter

This class is used to provide the filters used for discovery

Name Type Description
sourceFilter

string

filter for the test case sources (test containers)

testCaseFilter

string

filter for the test cases

RunStatistic

Test run statistics.

Name Type Description
count

integer

outcome

string

Test run outcome

resolutionState

TestResolutionState

state

string

State of the test run

RunUpdateModel

Name Type Description
build

ShallowReference

An abstracted reference to the build that it belongs.

buildDropLocation

string

buildFlavor

string

buildPlatform

string

comment

string

Comments entered by those analyzing the run.

completedDate

string

Completed date time of the run.

controller

string

Name of the test controller used for automated run.

deleteInProgressResults

boolean

dtlAutEnvironment

ShallowReference

An abstracted reference to DtlAutEnvironment.

dtlEnvironment

ShallowReference

An abstracted reference to DtlEnvironment.

dtlEnvironmentDetails

DtlEnvironmentDetails

This is a temporary class to provide the details for the test run environment.

dueDate

string

Due date and time for test run.

errorMessage

string

Error message associated with the run.

iteration

string

The iteration in which to create the run.

logEntries

TestMessageLogDetails[]

Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ...

name

string

Name of the test run.

releaseEnvironmentUri

string

releaseUri

string

sourceWorkflow

string

startedDate

string

Start date time of the run.

state

string

The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting

substate

TestRunSubstate

testEnvironmentId

string

testSettings

ShallowReference

An abstracted reference to test setting resource.

ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

Name Type Description
id

string

ID of the resource

name

string

Name of the linked resource (definition name, controller name, etc.)

url

string

Full http link to the resource

TestEnvironment

Name Type Description
environmentId

string

environmentName

string

TestMessageLogDetails

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

Name Type Description
dateCreated

string

Date when the resource is created

entryId

integer

Id of the resource

message

string

Message of the resource

TestResolutionState

Name Type Description
id

integer

name

string

project

ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

TestRun

Test run details.

Name Type Description
build

ShallowReference

Build associated with this test run.

buildConfiguration

BuildConfiguration

Build configuration details associated with this test run.

comment

string

Comments entered by those analyzing the run.

completedDate

string

Completed date time of the run.

controller

string

createdDate

string

customFields

CustomTestField[]

A custom field information.

dropLocation

string

dtlAutEnvironment

ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

dtlEnvironment

ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

dtlEnvironmentCreationDetails

DtlEnvironmentDetails

This is a temporary class to provide the details for the test run environment.

dueDate

string

Due date and time for test run.

errorMessage

string

Error message associated with the run.

filter

RunFilter

This class is used to provide the filters used for discovery

id

integer

ID of the test run.

incompleteTests

integer

isAutomated

boolean

true if test run is automated, false otherwise.

iteration

string

The iteration to which the run belongs.

lastUpdatedBy

IdentityRef

Team foundation ID of the last updated the test run.

lastUpdatedDate

string

Last updated date and time

name

string

Name of the test run.

notApplicableTests

integer

owner

IdentityRef

Team Foundation ID of the owner of the runs.

passedTests

integer

Number of passed tests in the run

phase

string

plan

ShallowReference

Test plan associated with this test run.

postProcessState

string

project

ShallowReference

Project associated with this run.

release

ReleaseReference

Reference to a release.

releaseEnvironmentUri

string

releaseUri

string

revision

integer

runStatistics

RunStatistic[]

Test run statistics.

startedDate

string

Start date time of the run.

state

string

The state of the run. { NotStarted, InProgress, Waiting }

substate

TestRunSubstate

testEnvironment

TestEnvironment

Test environment associated with the run.

testMessageLogId

integer

testSettings

ShallowReference

An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.

totalTests

integer

Total tests in the run

unanalyzedTests

integer

url

string

Url of the test run

webAccessUrl

string

TestRunSubstate

Name Type Description
abortedBySystem

string

analyzed

string

canceledByUser

string

cancellationInProgress

string

creatingEnvironment

string

none

string

pendingAnalysis

string

runningTests

string

timedOut

string