Skip to content

Commit 8a5b42c

Browse files
committed
feat: add automation_status field to test case creation
- Add automation_status as optional field to TestCaseCreateRequest interface - Add Zod schema validation with documentation for common values - Update sanitizeArgs function to handle automation_status null values - Add test coverage for the new field - Maintains backward compatibility (optional field)
1 parent ae1a149 commit 8a5b42c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/tools/testmanagement-utils/create-testcase.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface TestCaseCreateRequest {
2727
issue_tracker?: IssueTracker;
2828
tags?: string[];
2929
custom_fields?: Record<string, string>;
30+
automation_status?: string;
3031
}
3132

3233
export interface TestCaseResponse {
@@ -117,6 +118,12 @@ export const CreateTestCaseSchema = z.object({
117118
.record(z.string(), z.string())
118119
.optional()
119120
.describe("Map of custom field names to values."),
121+
automation_status: z
122+
.string()
123+
.optional()
124+
.describe(
125+
"Automation status of the test case. Common values include 'not_automated', 'automated', 'automation_not_required'.",
126+
),
120127
});
121128

122129
export function sanitizeArgs(args: any) {
@@ -125,6 +132,7 @@ export function sanitizeArgs(args: any) {
125132
if (cleaned.description === null) delete cleaned.description;
126133
if (cleaned.owner === null) delete cleaned.owner;
127134
if (cleaned.preconditions === null) delete cleaned.preconditions;
135+
if (cleaned.automation_status === null) delete cleaned.automation_status;
128136

129137
if (cleaned.issue_tracker) {
130138
if (

tests/tools/testmanagement.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ describe('createTestCaseTool', () => {
164164
issue_tracker: { name: 'jira', host: 'https://jira.example.com' },
165165
tags: ['smoke'],
166166
custom_fields: { priority: 'high' },
167+
automation_status: 'not_automated',
167168
};
168169

169170
const mockCallToolResult = {

0 commit comments

Comments
 (0)