@zzp123/mcp-zentao 1.8.2 → 1.8.3
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/dist/api/zentaoApi.d.ts +9 -3
- package/dist/api/zentaoApi.js +15 -15
- package/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/api/zentaoApi.d.ts
CHANGED
|
@@ -45,10 +45,16 @@ 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
|
+
* 修改需求(使用"更新需求(无需评审)"接口)
|
|
49
49
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
50
|
+
* 此方法使用自定义接口 POST /stories/:id/update-without-review
|
|
51
|
+
* 该接口会自动绕过评审人员验证,避免"该研发需求需要评审,评审人员不能为空"的错误
|
|
52
|
+
*
|
|
53
|
+
* 适用场景:
|
|
54
|
+
* - 系统配置了强制评审,但某些自动化场景不需要评审
|
|
55
|
+
* - API调用更新需求时无法提供评审人员
|
|
56
|
+
* - 批量导入或同步需求数据时
|
|
57
|
+
* - 第三方系统集成时自动更新需求
|
|
52
58
|
*
|
|
53
59
|
* @param storyId 需求ID
|
|
54
60
|
* @param update 需要更新的字段
|
package/dist/api/zentaoApi.js
CHANGED
|
@@ -607,10 +607,16 @@ export class ZentaoAPI {
|
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
/**
|
|
610
|
-
*
|
|
610
|
+
* 修改需求(使用"更新需求(无需评审)"接口)
|
|
611
611
|
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
612
|
+
* 此方法使用自定义接口 POST /stories/:id/update-without-review
|
|
613
|
+
* 该接口会自动绕过评审人员验证,避免"该研发需求需要评审,评审人员不能为空"的错误
|
|
614
|
+
*
|
|
615
|
+
* 适用场景:
|
|
616
|
+
* - 系统配置了强制评审,但某些自动化场景不需要评审
|
|
617
|
+
* - API调用更新需求时无法提供评审人员
|
|
618
|
+
* - 批量导入或同步需求数据时
|
|
619
|
+
* - 第三方系统集成时自动更新需求
|
|
614
620
|
*
|
|
615
621
|
* @param storyId 需求ID
|
|
616
622
|
* @param update 需要更新的字段
|
|
@@ -618,21 +624,15 @@ export class ZentaoAPI {
|
|
|
618
624
|
*/
|
|
619
625
|
async changeStory(storyId, update) {
|
|
620
626
|
try {
|
|
621
|
-
console.log(
|
|
622
|
-
//
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
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
|
-
console.log('修改需求响应:', response);
|
|
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);
|
|
631
|
+
console.log('更新需求响应:', response);
|
|
632
632
|
return response;
|
|
633
633
|
}
|
|
634
634
|
catch (error) {
|
|
635
|
-
console.error('
|
|
635
|
+
console.error('更新需求失败:', error);
|
|
636
636
|
throw error;
|
|
637
637
|
}
|
|
638
638
|
}
|
package/dist/index.js
CHANGED
|
@@ -581,10 +581,16 @@ server.tool("changeStory", {
|
|
|
581
581
|
comment: z.string().optional()
|
|
582
582
|
}),
|
|
583
583
|
z.string()
|
|
584
|
-
]).describe(
|
|
584
|
+
]).describe(`更新需求(无需评审)
|
|
585
585
|
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
此工具使用自定义接口 POST /stories/:id/update-without-review
|
|
587
|
+
该接口会自动绕过评审人员验证,避免"该研发需求需要评审,评审人员不能为空"的错误。
|
|
588
|
+
|
|
589
|
+
适用场景:
|
|
590
|
+
- 系统配置了强制评审,但某些自动化场景不需要评审
|
|
591
|
+
- API调用更新需求时无法提供评审人员
|
|
592
|
+
- 批量导入或同步需求数据时
|
|
593
|
+
- 第三方系统集成时自动更新需求
|
|
588
594
|
|
|
589
595
|
支持对象或JSON字符串格式。
|
|
590
596
|
`.trim())
|