create-test-cycle
Create a test cycle in qTest Test Execution to organize test runs by sprint, release, or regression campaign. Provide project ID and name; optionally specify a parent cycle.
Instructions
Test Execution — create a test cycle (execution folder) in qTest Test Execution to group test runs for a sprint, release, or regression campaign
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| name | Yes | Name of the new test cycle | |
| parentId | No | Parent test cycle ID; omit to create at root |
Implementation Reference
- src/server.ts:77-96 (registration)Registration of the 'create-test-cycle' tool with name, description, input schema, and handler callback
server.registerTool( 'create-test-cycle', { description: 'Test Execution — create a test cycle (execution folder) in qTest Test Execution to group test runs for a sprint, release, or regression campaign', inputSchema: { projectId: z.string(), name: z.string().describe('Name of the new test cycle'), parentId: z .number() .int() .optional() .describe('Parent test cycle ID; omit to create at root'), }, }, async ({ projectId, name, parentId }) => { const result = await createExecutionFolder({ projectId, name, parentId }) return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] } } ) - src/server.ts:79-91 (schema)Input schema for create-test-cycle: projectId (string), name (string), optional parentId (number)
{ description: 'Test Execution — create a test cycle (execution folder) in qTest Test Execution to group test runs for a sprint, release, or regression campaign', inputSchema: { projectId: z.string(), name: z.string().describe('Name of the new test cycle'), parentId: z .number() .int() .optional() .describe('Parent test cycle ID; omit to create at root'), }, }, - src/server.ts:92-95 (handler)Handler callback that calls createExecutionFolder with the provided arguments
async ({ projectId, name, parentId }) => { const result = await createExecutionFolder({ projectId, name, parentId }) return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] } } - Full implementation file: imports config and qtestFetch, defines CreateExecutionFolderArgs and ExecutionFolder interfaces, and exports the createExecutionFolder function that makes the API call
import { config } from '@/config.js' import { qtestFetch } from '@/client.js' export interface CreateExecutionFolderArgs { projectId: string name: string parentId?: number } export interface ExecutionFolder { id: number name: string parentId?: number } export async function createExecutionFolder( args: CreateExecutionFolderArgs ): Promise<ExecutionFolder> { const { projectId, name, parentId } = args const endpoint = parentId !== undefined ? `/test-cycles?parentId=${parentId}&parentType=test-cycle` : `/test-cycles?parentType=root` const result = await qtestFetch(config, projectId, endpoint, 'POST', { name, description: '', }) return result as ExecutionFolder } - src/server.ts:7-8 (helper)Import statement for createExecutionFolder from the helper implementation file
import { createExecutionFolder } from '@/tools/test_execution/create_test_cycle.js' import { addTestCases } from '@/tools/test_execution/add_test_cases.js'