2

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 ?

Max Ivanov
  • 5,695
  • 38
  • 52
Rajnish Tyagi
  • 47
  • 1
  • 6
  • Please check if the several answers below can resolve your issue, if yes, you could accept it as answer like [this](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235). – Walter Feb 15 '21 at 07:16

2 Answers2

2

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

Walter
  • 2,640
  • 1
  • 5
  • 11
2

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

Pratik Somaiya
  • 695
  • 5
  • 18
  • Hi @Rajnish : If my response helped you, can you please mark it as an answer so that we can have others from community to benefit from it :). Thanks ! – Pratik Somaiya Feb 12 '21 at 05:15