How to get the bug associated with a failed Test Case using 2015 REST APi's

Category: visual studio online

Question

Arutla on Thu, 09 Jun 2016 08:41:34


Hi,

I have a requirement, if a test case is failed, I need to get the BugId associated with a test case. Return the bug Id if it is in open state. Could you please guide me in implementation.

Regards,

Pradeep


Pradeep


Replies

Sapna Girish on Thu, 09 Jun 2016 20:28:17


Hello,

We are checking on the query and would get back to you soon on this.
I apologize for the inconvenience and appreciate your time and patience in this matter.

Regards,

Sapna Girish

Sunil Hurkadli on Tue, 05 Jul 2016 08:17:23


Sorry for delay in response.

You can use to following API: https://www.visualstudio.com/en-us/docs/integrate/api/test/results#get-a-test-result and look for the "associatedBugs" section in the response

Include detailsToInclude=2 as a parameter to fetch bugs linked to the result. We will be updating the documentation shortly to include the detailsToInclude parameter.

For test cases:

  1. Get all test points for a given test case -> https://www.visualstudio.com/en-us/docs/integrate/api/test/points#by-test-case, which will give you the latest test run and test result for the each of the test points. Example: https://<account>.visualstudio.com/DefaultCollection/FabrikamFiber/_apis/test/plans/<plan id>/suites/<suite id>/points?testcaseid=<test case id>&api-version=1.0
  2. Get the test result with detailsToInclude=2 -> https://www.visualstudio.com/en-us/docs/integrate/api/test/results#get-a-test-result and look for the "associatedBugs" section in the response. Example:  https://<account>.visualstudio.com/DefaultCollection/FabrikamFiber/_apis/test/runs/<run id>/results/<result id>?api-version=1.0-preview&detailsToInclude=2

 

Hope this helps.

Regards,

Sunil Hurkadli on Tue, 19 Jul 2016 14:35:07


Please write back on is provided information is helpful.

Regards,

Arutla on Tue, 19 Jul 2016 17:30:40


I didn't check the solution which is provided by you. As the reply I got from you is too late after my release date. 

I have followed different approach for finding the associated bugs for a failed Test case.

Sunil Hurkadli on Tue, 19 Jul 2016 17:45:27


Really sorry for inconvenience caused.

And we are happy to hear that issue is resolved. Please provide the details the different approach for finding the associated bugs for a failed Test case which you have used. So that it will help the other forum user who are facing the same problem.

Thank you for understanding.

Regards,