Skip to the content.

Fix a Query Based Suite’s query using REST API

This article shows how to update the query of a query-based test suite using REST API. This is particularly useful in cases where the query is now malformed (the area path referred in query is deleted etc.).

Get the ID of that Query Based Test Suite

You should be able to see the suite Id in the URL of your browser after you select the query-based test suite in the UI - https://dev.azure.com/<organizationName>/<projectName>/_testPlans/define?planId=3&suiteId=<suiteIdHere>

Then get a personal access token so that you can make the API calls below. You can give the token Test management write scope and it should work.

Use body as:

{
"queryString":"<your updated query>"
}

Make a HTTP PATCH call, it will update the query that was used for your Query Based Suite.