Hi B Siva Krishna,
Welcome to Microsoft Q&A,
Test plan and test suite are recoverable if you're on Azure DevOps Services (cloud) and it's been less than 14 days since the deletion.
There's no "Undo" button in the UI for test suites, but Azure DevOps soft deletes them for 14 days before permanent removal. You can pull it back using the Test Plan REST API.
Step 1: Find the deleted suite
GET https://dev.azure.com/{organization}/{project}/_apis/testplan/recycleBin/TestPlan/{planId}/testsuite?api-version=7.2-preview.1
This lists everything sitting in the recycle bin for that plan. Note the suiteId of the parent suite you lost.
Step 2: Restore it
PATCH https://dev.azure.com/{organization}/{project}/_apis/testplan/recycleBin/testsuite/{suiteId}?api-version=7.2-preview.1
Content-Type: application/json
{
"isDeleted": false
}
This brings back the suite along with its child suites and test cases.
A few things to keep in mind:
- This only works on Azure DevOps Services. On Azure DevOps Server, deletion is permanent, there's no recycle bin.
- The 14-day window is hard. Once it passes, it's gone for good.
- Test run results tied to the suite won't come back, only the plan/suite/test case structure.
- You'll need a PAT with the
vso.test_writescope, run it through curl, Postman, or a quick script.
If the GET call comes back empty, the suite is either past the 14 days or was deleted through a route that skipped soft delete, and in that case it can't be recovered.
Reference: Delete test artifacts in Azure Boards
Please Upvote and accept the answer if it helps!!