Rajnish Tyagi
Rajnish Tyagi

Reputation: 47

get pipeline specific run ID

i am working on azure rest api to get unit test count for specific project, and i found this api inside documents

GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?api-version=6.0

this gives me all the run id by which i can my unit test results by using another api call https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runid}/results?api-version=6.1-preview.6 but my problem is my project has multiple test pipeline, is there any way i get pipeline specific run id via passing pipeline id ?

Upvotes: 2

Views: 7766

Answers (2)

Pratik Somaiya
Pratik Somaiya

Reputation: 743

You can use below query:

GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs/{runId}?api-version=6.0-preview.1

Following are the parameters that you need to specify:

enter image description here

You will get detailed info on this here

Upvotes: 1

Walter
Walter

Reputation: 3058

GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?api-version=6.1-preview.3

We can find build id in the result.

enter image description here

  • We can add buildIds when using queue test runs API:

    GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&buildIds={buildIds}&api-version=6.1-preview.3

We can find build id and definition id from the result. enter image description here

Upvotes: 2

Related Questions