get_work_item_workflow
Retrieve workflow details for a specific work item type in Alibaba Cloud DevOps projects to understand process stages and transitions.
Instructions
[Project Management] Get workflow information for a specific work item type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | 企业ID,可在组织管理后台的基本信息页面获取 | |
| projectId | Yes | 项目唯一标识 | |
| workItemTypeId | Yes | 工作项类型ID |
Implementation Reference
- Tool handler case that parses arguments using the schema, calls the getWorkItemWorkflowFunc helper, and returns the workflow as JSON.case "get_work_item_workflow": { const args = types.GetWorkItemWorkflowSchema.parse(request.params.arguments); const workflow = await workitem.getWorkItemWorkflowFunc( args.organizationId, args.projectId, args.workItemTypeId ); return { content: [{ type: "text", text: JSON.stringify(workflow, null, 2) }], }; }
- operations/projex/types.ts:427-431 (schema)Zod schema definition for input parameters: organizationId, projectId, workItemTypeId.export const GetWorkItemWorkflowSchema = z.object({ organizationId: z.string().describe("企业ID,可在组织管理后台的基本信息页面获取"), projectId: z.string().describe("项目唯一标识"), workItemTypeId: z.string().describe("工作项类型ID"), });
- tool-registry/project-management.ts:97-101 (registration)Tool registration entry defining name, description, and input schema.{ name: "get_work_item_workflow", description: "[Project Management] Get workflow information for a specific work item type", inputSchema: zodToJsonSchema(types.GetWorkItemWorkflowSchema), },
- Core helper function that makes API request to retrieve work item workflow and handles response parsing.export async function getWorkItemWorkflowFunc( organizationId: string, projectId: string, workItemTypeId: string ): Promise<WorkItemWorkflow> { const url = `/oapi/v1/projex/organizations/${organizationId}/projects/${projectId}/workitemTypes/${workItemTypeId}/workflows`; const response = await yunxiaoRequest(url, { method: "GET", }); // 如果响应中包含result字段,则返回result中的数据 if (response && typeof response === 'object' && 'result' in response) { return response.result as WorkItemWorkflow; } // 否则直接返回响应 return response as WorkItemWorkflow; }