targetprocess-mcp-server 1.0.16 → 1.0.18-a
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/build/index.js +32 -16
- package/build/tp.js +2 -6
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -755,32 +755,48 @@ server.registerTool('get_not_covered_user_stories_in_feature', {
|
|
|
755
755
|
const userStoriesPromise = userStoriesIds.map((id) => tp.getUserStory(id));
|
|
756
756
|
let userStoriesResults = [];
|
|
757
757
|
try {
|
|
758
|
-
|
|
758
|
+
const results = await Promise.all(userStoriesPromise);
|
|
759
|
+
userStoriesResults = results.map((item) => item).flat();
|
|
759
760
|
}
|
|
760
761
|
catch (error) {
|
|
761
762
|
console.error("Error getting user stories:", error);
|
|
762
763
|
return {
|
|
763
764
|
content: [{
|
|
764
765
|
type: 'text',
|
|
765
|
-
text: `Failed to get user stories for feature id: ${id}`,
|
|
766
|
+
text: `Failed to get user stories for feature id: ${id}. Error: ${error}`,
|
|
767
|
+
}],
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
if (userStoriesResults.length === 0) {
|
|
771
|
+
return {
|
|
772
|
+
content: [{
|
|
773
|
+
type: 'text',
|
|
774
|
+
text: `No user stories promise found for feature id: ${id}`,
|
|
766
775
|
}],
|
|
767
776
|
};
|
|
768
777
|
}
|
|
769
778
|
let userStories = [];
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
779
|
+
try {
|
|
780
|
+
for (const userStory of userStoriesResults) {
|
|
781
|
+
const covered = userStory.CustomFields.find((field) => field.Name === "Test Automation")?.Value === "Done";
|
|
782
|
+
userStories.push({
|
|
783
|
+
id: userStory.Id,
|
|
784
|
+
name: userStory.Name,
|
|
785
|
+
description: userStory.Description,
|
|
786
|
+
featureId: userStory.Feature.Id,
|
|
787
|
+
featureName: userStory.Feature.Name,
|
|
788
|
+
covered,
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
catch (error) {
|
|
793
|
+
console.error("Error getting user stories:", error);
|
|
794
|
+
return {
|
|
795
|
+
content: [{
|
|
796
|
+
type: 'text',
|
|
797
|
+
text: `Failed to get user stories array for feature id: ${id}: Error: ${error}`,
|
|
798
|
+
}],
|
|
799
|
+
};
|
|
784
800
|
}
|
|
785
801
|
if (userStories.length === 0) {
|
|
786
802
|
return {
|
package/build/tp.js
CHANGED
|
@@ -80,12 +80,8 @@ export class TpClient {
|
|
|
80
80
|
}
|
|
81
81
|
async getUserStory(userStoryId) {
|
|
82
82
|
const response = await this.get({
|
|
83
|
-
pathParam: {
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
param: {
|
|
87
|
-
"format": "json",
|
|
88
|
-
},
|
|
83
|
+
pathParam: { "userStories": userStoryId },
|
|
84
|
+
param: { "format": "json" },
|
|
89
85
|
});
|
|
90
86
|
return response;
|
|
91
87
|
}
|