One of my customers had a very specific requirement around VSTS.

They previously used a different piece of software for their manual test management and as they started to use VSTS Test Manager, they noticed that they were missing the ability to create new test suites from a superset of tests in an existing test suite.

What they were looking for was a simple, visual way to select tests from a blueprint suite (with all available test cases in it), in order to create a child suite out of the selection. The requirement for this arose because they frequently change the order in which their testers run through sets of tests. (or suites)

There are ways to do this within the VSTS UI (for example with a set of query based suites, or by creating a new static suite and adding test by their ID) but none of the out-of-the-box solutions really worked for the customer’s scenario.

I decided to show them what they could do with a few REST calls on VSTS’ in-built API and built a Windows Forms application (not because it is necessarily the best way of doing it, just because I wanted quick results) with a REST client for their scenario.

Step 1: Gets all projects in the selected account (the account in hardcoded in this proof of concept application)

https://www.visualstudio.com/en-us/docs/integrate/api/tfs/projects#get-a-team-project

Step 2: Once a project is selected in the list above, all test plans are pulled and displayed. The user needs to pick one from the list, to trigger the next step.

https://www.visualstudio.com/en-us/docs/integrate/api/test/plans#get-a-list-of-test-plans

Step 3: Once a test plan is selected, all of its suites are displayed. The user can pick one again.

https://www.visualstudio.com/en-us/docs/integrate/api/test/suites#get-a-list-of-test-suites

Step 4: Once a test plan is selected, all of its test cases are displayed in a list. The user can pick as many as they like. They then specify a name for the child test suite.

https://www.visualstudio.com/en-us/docs/integrate/api/test/cases#get-a-list-of-test-cases

Step 5: Some validation checks are performed on the client. A new static test suite is then created and the selected tests are linked to it. A message is displayed to indicate to the user that the operation was successful.

https://www.visualstudio.com/en-us/docs/integrate/api/test/suites#create-a-test-suite

https://www.visualstudio.com/en-us/docs/integrate/api/test/suites#add-test-cases-to-a-suite

Learn more about getting started with the VSTS REST API