How to delete multiple test cases in Azure DevOps

流过昼夜 提交于 2020-06-26 21:17:20

问题


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?


回答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


来源:https://stackoverflow.com/questions/57051935/how-to-delete-multiple-test-cases-in-azure-devops

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!