@zzp123/mcp-zentao 1.8.3 → 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.8.5] - 2025-11-06
9
+
10
+ ### Improved
11
+ - **优化 changeStory 工具参数说明**
12
+ - 为 `reviewer` 字段添加详细描述:说明其通常为必填字段,除非设置 `needNotReview=true` 跳过评审
13
+ - 为 `needNotReview` 字段添加说明:如果不提供 `reviewer` 则应设置为 `true`
14
+ - 为 `storyId` 参数添加描述,提升工具可读性
15
+ - 为工具本身添加整体说明:"需求变更 - 支持对象或JSON字符串格式"
16
+
17
+ ### Technical
18
+ - 改进 MCP 工具的参数描述,帮助 AI 助手更好地理解参数使用规则
19
+ - 提升工具在 Claude Code 等 AI IDE 中的可用性
20
+
8
21
  ## [1.8.0] - 2025-11-06
9
22
 
10
23
  ### Changed
@@ -45,16 +45,10 @@ export declare class ZentaoAPI {
45
45
  createPlan(productId: number, plan: CreatePlanRequest): Promise<Plan>;
46
46
  getProjects(page?: number, limit?: number): Promise<Project[]>;
47
47
  /**
48
- * 修改需求(使用"更新需求(无需评审)"接口)
48
+ * 修改需求(使用 PUT /stories/:id 接口)
49
49
  *
50
- * 此方法使用自定义接口 POST /stories/:id/update-without-review
51
- * 该接口会自动绕过评审人员验证,避免"该研发需求需要评审,评审人员不能为空"的错误
52
- *
53
- * 适用场景:
54
- * - 系统配置了强制评审,但某些自动化场景不需要评审
55
- * - API调用更新需求时无法提供评审人员
56
- * - 批量导入或同步需求数据时
57
- * - 第三方系统集成时自动更新需求
50
+ * 此方法使用标准的"修改需求其他字段"接口(PUT),支持修改29个字段
51
+ * 自动处理评审人问题,避免"该研发需求需要评审,评审人员不能为空"的错误
58
52
  *
59
53
  * @param storyId 需求ID
60
54
  * @param update 需要更新的字段
@@ -607,16 +607,10 @@ export class ZentaoAPI {
607
607
  }
608
608
  }
609
609
  /**
610
- * 修改需求(使用"更新需求(无需评审)"接口)
610
+ * 修改需求(使用 PUT /stories/:id 接口)
611
611
  *
612
- * 此方法使用自定义接口 POST /stories/:id/update-without-review
613
- * 该接口会自动绕过评审人员验证,避免"该研发需求需要评审,评审人员不能为空"的错误
614
- *
615
- * 适用场景:
616
- * - 系统配置了强制评审,但某些自动化场景不需要评审
617
- * - API调用更新需求时无法提供评审人员
618
- * - 批量导入或同步需求数据时
619
- * - 第三方系统集成时自动更新需求
612
+ * 此方法使用标准的"修改需求其他字段"接口(PUT),支持修改29个字段
613
+ * 自动处理评审人问题,避免"该研发需求需要评审,评审人员不能为空"的错误
620
614
  *
621
615
  * @param storyId 需求ID
622
616
  * @param update 需要更新的字段
@@ -624,10 +618,16 @@ export class ZentaoAPI {
624
618
  */
625
619
  async changeStory(storyId, update) {
626
620
  try {
627
- console.log(`正在更新需求 ${storyId} (使用无需评审接口)...`);
628
- // 使用 POST /stories/:id/update-without-review 接口
629
- // 该接口会自动将当前用户设置为评审人员,绕过评审验证
630
- const response = await this.request('POST', `/stories/${storyId}/update-without-review`, undefined, update);
621
+ console.log(`正在更新需求 ${storyId}...`);
622
+ // 自动处理评审人问题
623
+ const updateData = { ...update };
624
+ // 如果用户没有设置评审人,也没有指定无需评审,则自动跳过评审
625
+ if (!updateData.reviewer && updateData.needNotReview !== true) {
626
+ updateData.needNotReview = true;
627
+ console.log('自动设置needNotReview=true以跳过评审要求');
628
+ }
629
+ // 使用 PUT /stories/:id 接口
630
+ const response = await this.request('PUT', `/stories/${storyId}`, undefined, updateData);
631
631
  console.log('更新需求响应:', response);
632
632
  return response;
633
633
  }
package/dist/index.js CHANGED
@@ -535,8 +535,8 @@ server.tool("getProjects", {
535
535
  };
536
536
  });
537
537
  // Add changeStory tool
538
- server.tool("changeStory", {
539
- storyId: z.number(),
538
+ server.tool("changeStory", "需求变更 - 支持对象或JSON字符串格式", {
539
+ storyId: z.number().describe("需求ID"),
540
540
  update: z.union([
541
541
  z.object({
542
542
  // 基本信息
@@ -563,7 +563,7 @@ server.tool("changeStory", {
563
563
  grade: z.number().optional(),
564
564
  // 人员相关
565
565
  mailto: z.array(z.string()).optional(),
566
- reviewer: z.array(z.string()).optional(),
566
+ reviewer: z.array(z.string()).optional().describe("评审人员列表(通常为必填,除非设置needNotReview=true跳过评审)"),
567
567
  assignedTo: z.string().optional(),
568
568
  closedBy: z.string().optional(),
569
569
  feedbackBy: z.string().optional(),
@@ -571,7 +571,7 @@ server.tool("changeStory", {
571
571
  closedReason: z.enum(['done', 'subdivided', 'duplicate', 'postponed', 'willnotdo', 'cancel', 'bydesign']).optional(),
572
572
  duplicateStory: z.number().optional(),
573
573
  // 评审相关
574
- needNotReview: z.boolean().optional(),
574
+ needNotReview: z.boolean().optional().describe("是否跳过评审,如果不提供reviewer则应设置为true"),
575
575
  // 通知相关
576
576
  notifyEmail: z.string().optional(),
577
577
  // 描述内容
@@ -581,16 +581,10 @@ server.tool("changeStory", {
581
581
  comment: z.string().optional()
582
582
  }),
583
583
  z.string()
584
- ]).describe(`更新需求(无需评审)
585
-
586
- 此工具使用自定义接口 POST /stories/:id/update-without-review
587
- 该接口会自动绕过评审人员验证,避免"该研发需求需要评审,评审人员不能为空"的错误。
584
+ ]).describe(`更新需求(使用 PUT 接口)
588
585
 
589
- 适用场景:
590
- - 系统配置了强制评审,但某些自动化场景不需要评审
591
- - API调用更新需求时无法提供评审人员
592
- - 批量导入或同步需求数据时
593
- - 第三方系统集成时自动更新需求
586
+ 此工具使用标准的"修改需求其他字段"接口(PUT /stories/:id),支持修改29个字段。
587
+ 自动处理评审人问题,无需手动设置 needNotReview。
594
588
 
595
589
  支持对象或JSON字符串格式。
596
590
  `.trim())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzp123/mcp-zentao",
3
- "version": "1.8.3",
3
+ "version": "1.8.5",
4
4
  "description": "禅道项目管理系统的高级API集成包,提供任务管理、Bug跟踪等功能的完整封装,专为Cursor IDE设计的MCP扩展",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",