Imagine the situation: You have a test plan in Azure DevOps that is executed every time you create a new version of your product, but Azure DevOps doesn’t provide an easy way to clone test plans and cloning manually is painful.
Fortunately the Azure DevOps REST API has a Clone Operation for test plans: Clone Operation – Clone Test Plan
I wrote a powershell script to make an API call to Clone operation in an easy way, just follow these steps:
- Download the script for cloning Azure DevOps Test Plans.
- $organization: Name of the Azure organization of your project. Marked with a green box.
- $PAT: Your Azure Personal Access Token (PAT). You must set “Test Management permission” to “Read & write”. For more details about PAT follow instructions at Authenticate access with personal access tokens.
- $project: Project name that contains the test plan. Marked in yellow.
- $testPlanId: Id of the test plan you want to clone. Marked in red.
- $testSuiteId: Id of the test suite you want to clone. Marked in purple.