Runs - Query

Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.

GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&api-version=5.0
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&state={state}&planIds={planIds}&isAutomated={isAutomated}&publishContext={publishContext}&buildIds={buildIds}&buildDefIds={buildDefIds}&branchName={branchName}&releaseIds={releaseIds}&releaseDefIds={releaseDefIds}&releaseEnvIds={releaseEnvIds}&releaseEnvDefIds={releaseEnvDefIds}&runTitle={runTitle}&$top={$top}&continuationToken={continuationToken}&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

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.

maxLastUpdatedDate
query True

string

date-time

Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).

minLastUpdatedDate
query True

string

date-time

Minimum Last Modified Date of run to be queried (Mandatory).

$top
query

integer

int32

Number of runs to be queried. Limit is 100

branchName
query

string

Source Branch name of the Runs to be queried.

buildDefIds
query

string

array (int32)

Build Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

buildIds
query

string

array (int32)

Build Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

continuationToken
query

string

continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user.

isAutomated
query

boolean

Automation type of the Runs to be queried.

planIds
query

string

array (int32)

Plan Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

publishContext
query

TestRunPublishContext

PublishContext of the Runs to be queried.

releaseDefIds
query

string

array (int32)

Release Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

releaseEnvDefIds
query

string

array (int32)

Release Environment Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

releaseEnvIds
query

string

array (int32)

Release Environment Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

releaseIds
query

string

array (int32)

Release Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).

runTitle
query

string

Run Title of the Runs to be queried.

state
query

TestRunState

Current state of the Runs to be queried.

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 Grants the ability to read test plans, cases, results and other test management related artifacts.

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.

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
TestResolutionState
TestRun

Test run details.

TestRunPublishContext

PublishContext of the Runs to be queried.

TestRunState
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

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

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

TestRunPublishContext

PublishContext of the Runs to be queried.

Name Type Description
all

string

Run is published for any Context.

build

string

Run is published for Build Context.

release

string

Run is published for Release Context.

TestRunState

Name Type Description
aborted

string

Run is stopped and remaing tests have been aborted

completed

string

All tests have completed or been skipped.

inProgress

string

Tests are running.

needsInvestigation

string

Run requires investigation because of a test point failure This is a legacy state and should not be used any more

notStarted

string

The run is still being created. No tests have started yet.

unspecified

string

Only used during an update to preserve the existing value.

waiting

string

Run is currently initializing This is a legacy state and should not be used any more

TestRunSubstate

Name Type Description
abortedBySystem

string

analyzed

string

canceledByUser

string

cancellationInProgress

string

creatingEnvironment

string

none

string

pendingAnalysis

string

runningTests

string

timedOut

string