update_case
Modify existing test cases in QASE by updating fields like title, description, steps, severity, priority, tags, and custom parameters to maintain accurate testing documentation.
Instructions
Update an existing test case
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| id | Yes | ||
| title | No | ||
| description | No | ||
| preconditions | No | ||
| postconditions | No | ||
| severity | No | ||
| priority | No | ||
| type | No | ||
| behavior | No | ||
| automation | No | ||
| status | No | ||
| suite_id | No | ||
| milestone_id | No | ||
| layer | No | ||
| is_flaky | No | ||
| params | No | ||
| tags | No | ||
| steps | No | ||
| custom_fields | No |
Implementation Reference
- src/index.ts:354-357 (handler)MCP tool handler for 'update_case': parses input using UpdateCaseSchema, extracts code, id, and rest data, then calls the updateCase function..with({ name: 'update_case' }, ({ arguments: args }) => { const { code, id, ...caseData } = UpdateCaseSchema.parse(args); return updateCase(code, id, caseData); })
- src/operations/cases.ts:49-93 (schema)Zod schema defining the input structure for updating a test case, including code, id, and optional fields like title, steps, tags, etc.export const UpdateCaseSchema = z.object({ code: z.string(), id: z.number(), title: z.string().optional(), description: z.string().optional(), preconditions: z.string().optional(), postconditions: z.string().optional(), severity: z.number().optional(), priority: z.number().optional(), type: z.number().optional(), behavior: z.number().optional(), automation: z.number().optional(), status: z.number().optional(), suite_id: z.number().optional(), milestone_id: z.number().optional(), layer: z.number().optional(), is_flaky: z.boolean().optional(), params: z .array( z.object({ title: z.string(), value: z.string(), }), ) .optional(), tags: z.array(z.string()).optional(), steps: z .array( z.object({ action: z.string(), expected_result: z.string().optional(), data: z.string().optional(), position: z.number().optional(), }), ) .optional(), custom_fields: z .array( z.object({ id: z.number(), value: z.string(), }), ) .optional(), });
- src/index.ts:185-189 (registration)Tool registration in the list of available tools, specifying name, description, and input schema converted to JSON schema.{ name: 'update_case', description: 'Update an existing test case', inputSchema: zodToJsonSchema(UpdateCaseSchema), },
- src/operations/cases.ts:172-179 (helper)Core updateCase function that transforms data using convertCaseData and calls the Qase client API to update the case, wrapped with toResult.export const updateCase = pipe( ( code: string, id: number, data: Omit<z.infer<typeof UpdateCaseSchema>, 'code' | 'id'>, ) => client.cases.updateCase(code, id, convertCaseData(data)), toResult, );
- src/operations/cases.ts:156-170 (helper)Helper function to convert the case data format, specifically handling is_flaky boolean to int and params array to object.const convertCaseData = ( data: Omit<z.infer<typeof UpdateCaseSchema>, 'code' | 'id'>, ) => ({ ...data, is_flaky: data.is_flaky === undefined ? undefined : data.is_flaky ? 1 : 0, params: data.params ? data.params.reduce( (acc, param) => ({ ...acc, [param.title]: [param.value], }), {}, ) : undefined, });