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. |
max
|
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). |
min
|
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 |
|
branch
|
query |
string |
Source Branch name of the Runs to be queried. |
|
build
|
query |
string array (int32) |
Build Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). |
|
build
|
query |
string array (int32) |
Build Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). |
|
continuation
|
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. |
|
is
|
query |
boolean |
Automation type of the Runs to be queried. |
|
plan
|
query |
string array (int32) |
Plan Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). |
|
publish
|
query |
PublishContext of the Runs to be queried. |
||
release
|
query |
string array (int32) |
Release Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). |
|
release
|
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). |
|
release
|
query |
string array (int32) |
Release Environment Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). |
|
release
|
query |
string array (int32) |
Release Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). |
|
run
|
query |
string |
Run Title of the Runs to be queried. |
|
state
|
query |
Current state of the Runs to be queried. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Test |
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 |
---|---|
Build |
|
Custom |
A custom field information. |
Dtl |
This is a temporary class to provide the details for the test run environment. |
Identity |
|
Reference |
The class to represent a collection of REST reference links. |
Release |
Reference to a release. |
Run |
This class is used to provide the filters used for discovery |
Run |
Test run statistics. |
Shallow |
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. |
Test |
|
Test |
|
Test |
Test run details. |
Test |
PublishContext of the Runs to be queried. |
Test |
|
Test |
BuildConfiguration
Name | Type | Description |
---|---|---|
branchName |
string |
|
buildDefinitionId |
integer |
|
buildSystem |
string |
|
creationDate |
string |
|
flavor |
string |
|
id |
integer |
|
number |
string |
|
platform |
string |
|
project |
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 |
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. |
ReferenceLinks
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 | ||
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 |
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 |
Build associated with this test run. |
|
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 |
A custom field information. |
|
dropLocation |
string |
|
dtlAutEnvironment |
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 |
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 |
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 |
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 |
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 |
Team Foundation ID of the owner of the runs. |
|
passedTests |
integer |
Number of passed tests in the run |
phase |
string |
|
plan |
Test plan associated with this test run. |
|
postProcessState |
string |
|
project |
Project associated with this run. |
|
release |
Reference to a release. |
|
releaseEnvironmentUri |
string |
|
releaseUri |
string |
|
revision |
integer |
|
runStatistics |
Test run statistics. |
|
startedDate |
string |
Start date time of the run. |
state |
string |
The state of the run. { NotStarted, InProgress, Waiting } |
substate | ||
testEnvironment |
Test environment associated with the run. |
|
testMessageLogId |
integer |
|
testSettings |
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 |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for