0
votes

I am trying to meet a requirement for work and am not sure if its a pipeline set up issue or what.

Essentially we have a pipeline release set up in Azure DevOps that runs our automated tests from a build that is connected to our automated project repo.

Once a run is done we get passed and failed test results. These automated test cases are associated with manual test cases written and stored in a test plan. When I view the failed test results programmatically I want to be able to view the related test plan id, suite Id, and test case ID in the data. How can this be achieved?

The only associated data I get is a test case reference id, but the only API I found to use this with was https://docs.microsoft.com/en-us/rest/api/azure/devops/testresults/result%20meta%20data?view=azure-devops-rest-6.0 However, this only gives me the name of tests .dll and some other info not useful for my goal.

Any assistance is appreciated.

1

1 Answers

1
votes

When I view the failed test results programmatically I want to be able to view the related test plan id, suite Id, and test case ID in the data. How can this be achieved?

You could try this Rest API : Results - Get

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

You could get the RunId and ResultId when you open the Test Case Result.

enter image description here

Tested with the automated tests, I could get the Test Case ID, Test Suite and Test Plan ID.

Here the Result sample:

enter image description here