testplan_create_test_plan
Create a new test plan in Azure DevOps by specifying the project, name, iteration, and optional details like description, dates, and area path.
Instructions
Creates a new test plan in the project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| areaPath | No | The area path for the test plan | |
| description | No | The description of the test plan | |
| endDate | No | The end date of the test plan | |
| iteration | Yes | The iteration path for the test plan | |
| name | Yes | The name of the test plan to be created. | |
| project | Yes | The unique identifier (ID or name) of the Azure DevOps project where the test plan will be created. | |
| startDate | No | The start date of the test plan |
Implementation Reference
- src/tools/testplans.ts:61-79 (handler)The handler function that executes the tool logic: connects to Azure DevOps, prepares TestPlanCreateParams, calls testPlanApi.createTestPlan, and returns the created test plan as JSON.async ({ project, name, iteration, description, startDate, endDate, areaPath }) => { const connection = await connectionProvider(); const testPlanApi = await connection.getTestPlanApi(); const testPlanToCreate: TestPlanCreateParams = { name, iteration, description, startDate: startDate ? new Date(startDate) : undefined, endDate: endDate ? new Date(endDate) : undefined, areaPath, }; const createdTestPlan = await testPlanApi.createTestPlan(testPlanToCreate, project); return { content: [{ type: "text", text: JSON.stringify(createdTestPlan, null, 2) }], }; }
- src/tools/testplans.ts:53-60 (schema)Zod schema defining the input parameters for creating a test plan: project, name, iteration, optional description, dates, and areaPath.project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project where the test plan will be created."), name: z.string().describe("The name of the test plan to be created."), iteration: z.string().describe("The iteration path for the test plan"), description: z.string().optional().describe("The description of the test plan"), startDate: z.string().optional().describe("The start date of the test plan"), endDate: z.string().optional().describe("The end date of the test plan"), areaPath: z.string().optional().describe("The area path for the test plan"), },
- src/tools/testplans.ts:50-79 (registration)The server.tool registration call that registers the 'testplan_create_test_plan' tool with its description, input schema, and inline handler function.Test_Plan_Tools.create_test_plan, "Creates a new test plan in the project.", { project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project where the test plan will be created."), name: z.string().describe("The name of the test plan to be created."), iteration: z.string().describe("The iteration path for the test plan"), description: z.string().optional().describe("The description of the test plan"), startDate: z.string().optional().describe("The start date of the test plan"), endDate: z.string().optional().describe("The end date of the test plan"), areaPath: z.string().optional().describe("The area path for the test plan"), }, async ({ project, name, iteration, description, startDate, endDate, areaPath }) => { const connection = await connectionProvider(); const testPlanApi = await connection.getTestPlanApi(); const testPlanToCreate: TestPlanCreateParams = { name, iteration, description, startDate: startDate ? new Date(startDate) : undefined, endDate: endDate ? new Date(endDate) : undefined, areaPath, }; const createdTestPlan = await testPlanApi.createTestPlan(testPlanToCreate, project); return { content: [{ type: "text", text: JSON.stringify(createdTestPlan, null, 2) }], }; }