1

I want to delete multiple test cases in one go in Azure DevOps. Currently, portal only allows to delete one at a time.

Is there any way to achieve this using PowerShell script or REST API?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114

1 Answers1

1

You can use the Test Cases - Delete Rest API:

DELETE https://dev.azure.com/{organization}/{project}/_apis/test/testcases/{id}?api-version=5.0-preview.1

So you can loop the test cases id's and delete them.

Example for simple PowerShell script:

$url = https://dev.azure.com/testOrg/testProj/_apis/test/testcases/10?api-version=5.0-preview.1
Invoke-RestMethod -Uri $url -Method Delete -ContentType application/json
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114