feat: Add testplan_get_suites_by_test_case_id tool for reverse suite membership lookup #1267
alexneo2003
started this conversation in
Backlog of Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Implement a new tool that integrates with Azure DevOps Test Plans API to enable reverse-lookup of test suite membership by test case ID — a critical missing capability for efficient test case management workflows.
Problem
Currently, determining which test suites contain a specific test case requires a forward-scan approach:
testplan_list_test_suites)testplan_list_test_caseswithcontinuationToken)For plans with many suites and hundreds of test cases per suite, this results in 10–20+ API calls transferring large paginated payloads (~50KB+ per page), just to answer a simple question: "Which suites contain test case X?"
This is a common need for CI/CD pipelines that validate test case organization, automated test registration workflows, and test plan audit tools.
Solution
The Azure DevOps REST API already provides a dedicated reverse-lookup endpoint that returns all suites containing a given test case in a single lightweight call:
Tools
Develop the following tool with full parameter support, including optional ones:
testplan_get_suites_by_test_case_id: Get all test suites that contain a specific test case.Endpoint: GET https://dev.azure.com/{organization}/_apis/testplan/suites?testCaseId={testCaseId}&api-version=7.2-preview.1
Parameters
testCaseIdnumberResponse
Returns an array of
TestSuiteobjects, each containing:id— Suite IDname— Suite nameplan— Parent test plan reference ({ id, name })parentSuite— Parent suite reference (if nested)suiteType— Type of suite (static, dynamic, requirement-based)Reference: Suites - Get Suites By Test Case Id
Benefits
continuationTokenhandling needed for this use casetestplan_list_test_suites(plan → suites) andtestplan_list_test_cases(suite → cases) by adding the reverse direction (case → suites)Rules
fetch()-based pattern used bytestplan_list_test_plansandtestplan_list_test_casesinsrc/tools/test-plans.ts.Test_Plan_Toolsconstant object.test/src/tools/test-plan.test.ts.Special treat
If you follow the rules, you'll get candy! 🍬
Beta Was this translation helpful? Give feedback.
All reactions