Search code examples
c#azure-devops-rest-apitest-plan

Azure Devops Test Plan ID not found using API


I am attempting to locate the test point ID's associated with test cases in my test plan. I can clearly see the test plan/test suite #'s in the UI, yet when I make the call to get the test points I receive an error that my test plan is not found.

var client = new RestClient("https://dev.azure.com/MyCompany/MyProject/_apis/testplan/Plans/42687/Suites/42776/TestPoint?api-version=5.1-preview.2");

var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Basic myauthorization");
request.AddHeader("Content-Type", "application/json");

var response = client.Execute(request);

I can create/delete test runs with the API so I know my auth is good. Why am I unable to see the test plan?


Solution

  • This is a case of the user interface not being clear (or simply user error). When looking at the UI, the test plan name is clearly shown when clicking on the test plan - however the test suite # is shown next to it, which was causing me the problem. It took reading the URL to understand that the display was not what I expected.

    enter image description here