create_work_item_comment
Add comments to work items in Alibaba Cloud DevOps projects to document discussions, provide updates, or clarify requirements for team collaboration.
Instructions
[Project Management] Create a comment for a specific work item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | 企业ID,可在组织管理后台的基本信息页面获取 | |
| workItemId | Yes | 工作项ID | |
| content | Yes | 评论内容 |
Implementation Reference
- Handler for create_work_item_comment tool: parses arguments using schema, calls createWorkItemCommentFunc, and returns JSON response.case "create_work_item_comment": { const args = types.CreateWorkItemCommentSchema.parse(request.params.arguments); const comment = await workitem.createWorkItemCommentFunc( args.organizationId, args.workItemId, args.content ); return { content: [{ type: "text", text: JSON.stringify(comment, null, 2) }], }; }
- tool-registry/project-management.ts:108-111 (registration)Tool registration entry for create_work_item_comment with name, description, and input schema.name: "create_work_item_comment", description: "[Project Management] Create a comment for a specific work item", inputSchema: zodToJsonSchema(types.CreateWorkItemCommentSchema), }
- operations/projex/types.ts:362-366 (schema)Zod schema definition for CreateWorkItemComment input validation: organizationId, workItemId, content.export const CreateWorkItemCommentSchema = z.object({ organizationId: z.string().describe("企业ID,可在组织管理后台的基本信息页面获取"), workItemId: z.string().describe("工作项ID"), content: z.string().describe("评论内容"), });
- Core implementation: POST request to Yunxiao API endpoint to create a comment on a work item.export async function createWorkItemCommentFunc( organizationId: string, workItemId: string, content: string ): Promise<any> { const url = `/oapi/v1/projex/organizations/${organizationId}/workitems/${workItemId}/comments`; const payload = { content: content }; const response = await yunxiaoRequest(url, { method: "POST", body: payload, }); // 如果响应中包含result字段,则返回result中的数据 if (response && typeof response === 'object' && 'result' in response) { return response.result; } // 否则直接返回响应 return response; }