targetprocess-mcp-server 2.6.8 → 2.7.0
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/handlers/add_comment.js +2 -2
- package/build/handlers/add_test_case_step_by_id.js +2 -2
- package/build/handlers/create_bug.js +2 -2
- package/build/handlers/create_bug_based_on_card.js +2 -2
- package/build/handlers/create_epic.js +2 -2
- package/build/handlers/create_feature.js +2 -2
- package/build/handlers/create_formatted_feature.js +2 -2
- package/build/handlers/create_formatted_user_story.js +2 -2
- package/build/handlers/create_task.js +2 -2
- package/build/handlers/create_user_story.js +2 -2
- package/build/handlers/get_bug_comments.js +1 -1
- package/build/handlers/get_bug_content.js +2 -2
- package/build/handlers/get_bug_workflows.js +2 -2
- package/build/handlers/get_card_current_status.js +1 -1
- package/build/handlers/get_commit_message.js +2 -2
- package/build/handlers/get_current_releases.js +2 -2
- package/build/handlers/get_epic_content.js +2 -2
- package/build/handlers/get_epic_features.js +1 -1
- package/build/handlers/get_feature_comments.js +1 -1
- package/build/handlers/get_feature_content.js +2 -2
- package/build/handlers/get_feature_user_stories.js +1 -1
- package/build/handlers/get_logged_in_user.js +2 -2
- package/build/handlers/get_my_time_logs.js +2 -2
- package/build/handlers/get_process_workflows.js +2 -2
- package/build/handlers/get_processes.js +2 -2
- package/build/handlers/get_projects.js +2 -2
- package/build/handlers/get_relation_types.js +1 -1
- package/build/handlers/get_release_bugs.js +2 -2
- package/build/handlers/get_release_features.js +2 -2
- package/build/handlers/get_release_open_bugs.js +2 -2
- package/build/handlers/get_release_open_user_stories.js +2 -2
- package/build/handlers/get_release_user_stories.js +2 -2
- package/build/handlers/get_team_iterations.js +2 -2
- package/build/handlers/get_teams.js +4 -4
- package/build/handlers/get_test_case_by_id.js +2 -2
- package/build/handlers/get_test_plan_by_id.js +2 -2
- package/build/handlers/get_test_plan_test_cases_with_steps_by_id.js +2 -2
- package/build/handlers/get_user_by_id.js +2 -2
- package/build/handlers/get_user_story_bugs.js +1 -1
- package/build/handlers/get_user_story_comments.js +1 -1
- package/build/handlers/get_user_story_content.js +2 -2
- package/build/handlers/get_user_story_workflows.js +2 -2
- package/build/handlers/get_users.js +2 -2
- package/build/handlers/list_my_bugs.js +2 -2
- package/build/handlers/list_my_user_stories.js +2 -2
- package/build/handlers/log_time.js +1 -1
- package/build/handlers/update_bug.js +2 -2
- package/build/handlers/update_epic.js +2 -2
- package/build/handlers/update_feature.js +2 -2
- package/build/handlers/update_test_case_by_id.js +2 -2
- package/build/handlers/update_test_case_step_by_id.js +4 -4
- package/build/handlers/update_user_story_sub_state.js +2 -2
- package/build/index.js +27 -11
- package/build/tp.js +18 -6
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleAddComment(tp, id, comment) {
|
|
2
2
|
const response = await tp.addComment(id, comment);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to add comment to user story, id: ${id}\n
|
|
7
|
+
text: `Failed to add comment to user story, id: ${id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -3,11 +3,11 @@ export async function handleAddTestCaseStepById(tp, params) {
|
|
|
3
3
|
description: params.description,
|
|
4
4
|
result: params.result,
|
|
5
5
|
});
|
|
6
|
-
if (
|
|
6
|
+
if (testStepResponse instanceof Error) {
|
|
7
7
|
return {
|
|
8
8
|
content: [{
|
|
9
9
|
type: 'text',
|
|
10
|
-
text: `Failed to add test step to test case id: ${params.testCaseId}\n
|
|
10
|
+
text: `Failed to add test step to test case id: ${params.testCaseId}\n Error: ${testStepResponse.message}`
|
|
11
11
|
}],
|
|
12
12
|
};
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateBug(tp, params) {
|
|
2
2
|
const bugResponse = await tp.createBugOnly(params);
|
|
3
|
-
if (
|
|
3
|
+
if (bugResponse instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create bug "${params.title}"\n
|
|
7
|
+
text: `Failed to create bug "${params.title}"\n Error: ${bugResponse.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateBugBasedOnCard(tp, params) {
|
|
2
2
|
const bugResponse = await tp.createBug(params);
|
|
3
|
-
if (
|
|
3
|
+
if (bugResponse instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create bug "${params.title}"\n
|
|
7
|
+
text: `Failed to create bug "${params.title}"\n Error: ${bugResponse.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateEpic(tp, params) {
|
|
2
2
|
const response = await tp.createEpic(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create epic "${params.title}"\n
|
|
7
|
+
text: `Failed to create epic "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateFeature(tp, params) {
|
|
2
2
|
const response = await tp.createFeature(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create feature "${params.title}"\n
|
|
7
|
+
text: `Failed to create feature "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -67,11 +67,11 @@ export async function handleCreateFormattedFeature(tp, params) {
|
|
|
67
67
|
parts.push('</div>');
|
|
68
68
|
const description = parts.join('\n');
|
|
69
69
|
const featureResponse = await tp.createFeature({ title, description, epicId, releaseId, projectId, teamId });
|
|
70
|
-
if (
|
|
70
|
+
if (featureResponse instanceof Error) {
|
|
71
71
|
return {
|
|
72
72
|
content: [{
|
|
73
73
|
type: 'text',
|
|
74
|
-
text: `Failed to create formatted feature "${title}"\n
|
|
74
|
+
text: `Failed to create formatted feature "${title}"\n Error: ${featureResponse.message}`
|
|
75
75
|
}],
|
|
76
76
|
};
|
|
77
77
|
}
|
|
@@ -41,11 +41,11 @@ export async function handleCreateFormattedUserStory(tp, params) {
|
|
|
41
41
|
parts.push('</div>');
|
|
42
42
|
const description = parts.join('\n');
|
|
43
43
|
const userStoryResponse = await tp.createUserStory({ title, description, featureId, releaseId, projectId, teamId, tags, teamIterationId });
|
|
44
|
-
if (
|
|
44
|
+
if (userStoryResponse instanceof Error) {
|
|
45
45
|
return {
|
|
46
46
|
content: [{
|
|
47
47
|
type: 'text',
|
|
48
|
-
text: `Failed to create formatted user story "${title}"\n
|
|
48
|
+
text: `Failed to create formatted user story "${title}"\n Error: ${userStoryResponse.message}`
|
|
49
49
|
}],
|
|
50
50
|
};
|
|
51
51
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateTask(tp, params) {
|
|
2
2
|
const response = await tp.createTask(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create task "${params.title}"\n
|
|
7
|
+
text: `Failed to create task "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleCreateUserStory(tp, params) {
|
|
2
2
|
const response = await tp.createUserStory(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to create user story "${params.title}"\n
|
|
7
|
+
text: `Failed to create user story "${params.title}"\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetBugContent(tp, id) {
|
|
3
3
|
const bug = await tp.getBug(id);
|
|
4
|
-
if (
|
|
4
|
+
if (bug instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get bug, id: ${id}\n
|
|
8
|
+
text: `Failed to get bug, id: ${id}\n Error: ${bug.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetBugWorkflows(tp) {
|
|
2
2
|
const response = await tp.getBugWorkflows();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get bug entity statuses,
|
|
7
|
+
text: `Failed to get bug entity statuses, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function handleGetCommitMessage(tp, id, type) {
|
|
2
2
|
if (type === 'task') {
|
|
3
3
|
const task = await tp.getTask(id);
|
|
4
|
-
if (
|
|
4
|
+
if (task instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{ type: 'text', text: `Failed to get task with id: ${id}` }],
|
|
7
7
|
};
|
|
@@ -21,7 +21,7 @@ export async function handleGetCommitMessage(tp, id, type) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
const bug = await tp.getBugWithRelations(id);
|
|
24
|
-
if (
|
|
24
|
+
if (bug instanceof Error) {
|
|
25
25
|
return {
|
|
26
26
|
content: [{ type: 'text', text: `Failed to get bug with id: ${id}` }],
|
|
27
27
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetCurrentReleases(tp) {
|
|
2
2
|
const releases = await tp.getCurrentReleases();
|
|
3
|
-
if (
|
|
3
|
+
if (releases instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get current releases,
|
|
7
|
+
text: `Failed to get current releases, Error: ${releases.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetEpicContent(tp, id) {
|
|
3
3
|
const epic = await tp.getEpic(id);
|
|
4
|
-
if (
|
|
4
|
+
if (epic instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get epic, id: ${id}\n
|
|
8
|
+
text: `Failed to get epic, id: ${id}\n Error: ${epic.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetFeatureContent(tp, id) {
|
|
3
3
|
const feature = await tp.getFeature(id);
|
|
4
|
-
if (
|
|
4
|
+
if (feature instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get feature, id: ${id}\n
|
|
8
|
+
text: `Failed to get feature, id: ${id}\n Error: ${feature.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetLoggedInUser(tp) {
|
|
2
2
|
const ctx = await tp.getContext();
|
|
3
|
-
if (
|
|
3
|
+
if (ctx instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get context,
|
|
7
|
+
text: `Failed to get context, Error: ${ctx.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetMyTimeLogs(tp, take) {
|
|
2
2
|
const response = await tp.getMyTimeLogs(take);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get time logs,
|
|
7
|
+
text: `Failed to get time logs, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetProcessWorkflows(tp, processId) {
|
|
2
2
|
const response = await tp.getProcessWorkflows({ processId });
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get process workflows,
|
|
7
|
+
text: `Failed to get process workflows, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetProcesses(tp) {
|
|
2
2
|
const response = await tp.getProcesses();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get processes,
|
|
7
|
+
text: `Failed to get processes, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetProjects(tp) {
|
|
2
2
|
const response = await tp.getProjects();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get projects,
|
|
7
|
+
text: `Failed to get projects, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseBugs(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseBugs({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release bugs,
|
|
7
|
+
text: `Failed to get ${name} release bugs, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseFeatures(tp, name, results) {
|
|
2
2
|
const release = await tp.getReleaseFeatures({ name, results });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release features,
|
|
7
|
+
text: `Failed to get ${name} release features, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseOpenBugs(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseOpenBugs({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release bugs,
|
|
7
|
+
text: `Failed to get ${name} release bugs, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseOpenUserStories(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseOpenUserStories({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release user stories,
|
|
7
|
+
text: `Failed to get ${name} release user stories, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetReleaseUserStories(tp, name, results, withDescription) {
|
|
2
2
|
const release = await tp.getReleaseUserStories({ name, results, withDescription });
|
|
3
|
-
if (
|
|
3
|
+
if (release instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get ${name} release user stories,
|
|
7
|
+
text: `Failed to get ${name} release user stories, Error: ${release.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetTeamIterations(tp, params) {
|
|
2
2
|
const response = await tp.getTeamIterations(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get team iterations,
|
|
7
|
+
text: `Failed to get team iterations, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetTeams(tp) {
|
|
2
2
|
const response = await tp.getTeams();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get teams,
|
|
7
|
+
text: `Failed to get teams, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -21,11 +21,11 @@ export async function handleGetTeams(tp) {
|
|
|
21
21
|
export async function handleGetTeamsAndTeamAssignments(tp) {
|
|
22
22
|
const teams = await tp.getTeams();
|
|
23
23
|
const teamAssignments = await tp.getTeamAssignments();
|
|
24
|
-
if (
|
|
24
|
+
if (teams instanceof Error || teamAssignments instanceof Error) {
|
|
25
25
|
return {
|
|
26
26
|
content: [{
|
|
27
27
|
type: 'text',
|
|
28
|
-
text: `Failed to get teams and team assignments,
|
|
28
|
+
text: `Failed to get teams and team assignments, Error: ${teams instanceof Error ? teams.message : teamAssignments instanceof Error ? teamAssignments.message : ''}`
|
|
29
29
|
}],
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetTestCaseById(tp, id) {
|
|
3
3
|
const testCase = await tp.getTestCase(id);
|
|
4
|
-
if (
|
|
4
|
+
if (testCase instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get test case id: ${id}\n
|
|
8
|
+
text: `Failed to get test case id: ${id}\n Error: ${testCase.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetTestPlanById(tp, id) {
|
|
3
3
|
const testPlan = await tp.getTestPlan(id);
|
|
4
|
-
if (
|
|
4
|
+
if (testPlan instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: "text",
|
|
8
|
-
text: `Failed to get test plan id: ${id}\n
|
|
8
|
+
text: `Failed to get test plan id: ${id}\n Error: ${testPlan.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetTestPlanTestCasesWithStepsById(tp, id) {
|
|
3
3
|
const response = await tp.getTestPlanTestCases(id);
|
|
4
|
-
if (
|
|
4
|
+
if (response instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get test cases for test plan id: ${id}\n
|
|
8
|
+
text: `Failed to get test cases for test plan id: ${id}\n Error: ${response.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetUserById(tp, id) {
|
|
2
2
|
const user = await tp.getUser(id);
|
|
3
|
-
if (
|
|
3
|
+
if (user instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get user, id: ${id}\n
|
|
7
|
+
text: `Failed to get user, id: ${id}\n Error: ${user.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export async function handleGetUserStoryContent(tp, id) {
|
|
3
3
|
const userStory = await tp.getUserStory(id);
|
|
4
|
-
if (
|
|
4
|
+
if (userStory instanceof Error) {
|
|
5
5
|
return {
|
|
6
6
|
content: [{
|
|
7
7
|
type: 'text',
|
|
8
|
-
text: `Failed to get user story, id: ${id}\n
|
|
8
|
+
text: `Failed to get user story, id: ${id}\n Error: ${userStory.message}`
|
|
9
9
|
}],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetUserStoryWorkflows(tp) {
|
|
2
2
|
const response = await tp.getUserStoryWorkflowsWithSubStates();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get user story entity statuses,
|
|
7
|
+
text: `Failed to get user story entity statuses, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleGetUsers(tp) {
|
|
2
2
|
const response = await tp.getUsers();
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get users,
|
|
7
|
+
text: `Failed to get users, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleListMyBugs(tp, params) {
|
|
2
2
|
const response = await tp.getMyBugs(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get bugs,
|
|
7
|
+
text: `Failed to get bugs, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleListMyUserStories(tp, params) {
|
|
2
2
|
const response = await tp.getMyUserStories(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to get user stories,
|
|
7
|
+
text: `Failed to get user stories, Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateBug(tp, params) {
|
|
2
2
|
const bugResponse = await tp.updateBug(params);
|
|
3
|
-
if (
|
|
3
|
+
if (bugResponse instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update bug "${params.title}"\n
|
|
7
|
+
text: `Failed to update bug "${params.title}"\n Error: ${bugResponse.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateEpic(tp, params) {
|
|
2
2
|
const response = await tp.updateEpic(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update epic id: ${params.id}\n
|
|
7
|
+
text: `Failed to update epic id: ${params.id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateFeature(tp, params) {
|
|
2
2
|
const response = await tp.updateFeature(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update feature id: ${params.id}\n
|
|
7
|
+
text: `Failed to update feature id: ${params.id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -8,11 +8,11 @@ export async function handleUpdateTestCaseById(tp, params) {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
const testCaseResponse = await tp.updateTestCase(params);
|
|
11
|
-
if (
|
|
11
|
+
if (testCaseResponse instanceof Error) {
|
|
12
12
|
return {
|
|
13
13
|
content: [{
|
|
14
14
|
type: 'text',
|
|
15
|
-
text: `Failed to update test case id: ${params.id}\n
|
|
15
|
+
text: `Failed to update test case id: ${params.id}\n Error: ${testCaseResponse.message}`
|
|
16
16
|
}],
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -8,11 +8,11 @@ export async function handleUpdateTestCaseStepById(tp, params) {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
const existingTestStep = await tp.getTestStep(params.id);
|
|
11
|
-
if (
|
|
11
|
+
if (existingTestStep instanceof Error) {
|
|
12
12
|
return {
|
|
13
13
|
content: [{
|
|
14
14
|
type: 'text',
|
|
15
|
-
text: `Failed to get test step id: ${params.id}\n
|
|
15
|
+
text: `Failed to get test step id: ${params.id}\n Error: ${existingTestStep.message}`
|
|
16
16
|
}],
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -21,11 +21,11 @@ export async function handleUpdateTestCaseStepById(tp, params) {
|
|
|
21
21
|
description: params.description ?? existingTestStep.Description,
|
|
22
22
|
result: params.result ?? existingTestStep.Result,
|
|
23
23
|
});
|
|
24
|
-
if (
|
|
24
|
+
if (testStepResponse instanceof Error) {
|
|
25
25
|
return {
|
|
26
26
|
content: [{
|
|
27
27
|
type: 'text',
|
|
28
|
-
text: `Failed to update test step id: ${params.id}\n
|
|
28
|
+
text: `Failed to update test step id: ${params.id}\n Error: ${testStepResponse.message}`
|
|
29
29
|
}],
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export async function handleUpdateUserStorySubState(tp, params) {
|
|
2
2
|
const response = await tp.updateUserStorySubState(params);
|
|
3
|
-
if (
|
|
3
|
+
if (response instanceof Error) {
|
|
4
4
|
return {
|
|
5
5
|
content: [{
|
|
6
6
|
type: 'text',
|
|
7
|
-
text: `Failed to update user story sub state id: ${params.id}\n
|
|
7
|
+
text: `Failed to update user story sub state id: ${params.id}\n Error: ${response.message}`
|
|
8
8
|
}],
|
|
9
9
|
};
|
|
10
10
|
}
|
package/build/index.js
CHANGED
|
@@ -280,7 +280,7 @@ server.registerTool('add_comment_with_user', {
|
|
|
280
280
|
}, async ({ id, comment, user }) => {
|
|
281
281
|
try {
|
|
282
282
|
const addCommentResponse = await tp.addCommentWithUser(id, comment, user);
|
|
283
|
-
if (
|
|
283
|
+
if (addCommentResponse instanceof Error) {
|
|
284
284
|
return {
|
|
285
285
|
content: [{
|
|
286
286
|
type: 'text',
|
|
@@ -491,8 +491,24 @@ server.registerTool('set_business_value', {
|
|
|
491
491
|
.describe('Priority ID — resolve via "get_priorities" first'),
|
|
492
492
|
},
|
|
493
493
|
}, async ({ id, entityType, priorityId }) => {
|
|
494
|
+
if (entityType === 'UserStories') {
|
|
495
|
+
const story = await tp.getUserStory(id);
|
|
496
|
+
const featureId = story?.Feature?.Id;
|
|
497
|
+
if (featureId) {
|
|
498
|
+
const siblings = await tp.getUserStoriesInFeatureWithPriority(String(featureId));
|
|
499
|
+
const conflict = (siblings?.Items ?? []).find((s) => String(s.Id) !== String(id) && s.Priority?.Id === parseInt(priorityId));
|
|
500
|
+
if (conflict) {
|
|
501
|
+
return {
|
|
502
|
+
content: [{
|
|
503
|
+
type: 'text',
|
|
504
|
+
text: `Cannot set Business Value: story "${conflict.Name}" (${conflict.Id}) in the same feature already has this priority. Choose a different value.`,
|
|
505
|
+
}],
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
494
510
|
const response = await tp.setBusinessValue({ id, entityType, priorityId });
|
|
495
|
-
if (
|
|
511
|
+
if (response instanceof Error) {
|
|
496
512
|
return { content: [{ type: 'text', text: `Failed to set business value on ${entityType} ${id}` }] };
|
|
497
513
|
}
|
|
498
514
|
return { content: [{ type: 'text', text: JSON.stringify(response) }] };
|
|
@@ -546,7 +562,7 @@ server.registerTool('update_user_story', {
|
|
|
546
562
|
},
|
|
547
563
|
}, async ({ id, title, description, projectId, teamId, entityStateId, featureId, tags, teamIterationId }) => {
|
|
548
564
|
const response = await tp.updateUserStory({ id, title, description, projectId, teamId, entityStateId, featureId, tags, teamIterationId });
|
|
549
|
-
if (
|
|
565
|
+
if (response instanceof Error) {
|
|
550
566
|
return {
|
|
551
567
|
content: [{
|
|
552
568
|
type: 'text',
|
|
@@ -1010,7 +1026,7 @@ server.registerTool('create_test_plan', {
|
|
|
1010
1026
|
},
|
|
1011
1027
|
}, async ({ title, resourceId, resourceType, description }) => {
|
|
1012
1028
|
const testPlanResponse = await tp.createTestPlan(title, resourceId, resourceType, { description });
|
|
1013
|
-
if (
|
|
1029
|
+
if (testPlanResponse instanceof Error) {
|
|
1014
1030
|
return {
|
|
1015
1031
|
content: [{
|
|
1016
1032
|
type: 'text',
|
|
@@ -1036,7 +1052,7 @@ server.registerTool('get_not_covered_user_stories_in_feature', {
|
|
|
1036
1052
|
},
|
|
1037
1053
|
}, async ({ id }) => {
|
|
1038
1054
|
const response = await tp.getUserStoriesIdsByFeatureId(id);
|
|
1039
|
-
if (
|
|
1055
|
+
if (response instanceof Error) {
|
|
1040
1056
|
return {
|
|
1041
1057
|
content: [{
|
|
1042
1058
|
type: 'text',
|
|
@@ -1233,7 +1249,7 @@ server.registerTool('get_user_story_test_cases', {
|
|
|
1233
1249
|
},
|
|
1234
1250
|
}, async ({ resourceId }) => {
|
|
1235
1251
|
const userStoryResponse = await tp.getUserStoryTestPlan(resourceId);
|
|
1236
|
-
if (
|
|
1252
|
+
if (userStoryResponse instanceof Error) {
|
|
1237
1253
|
return {
|
|
1238
1254
|
content: [{
|
|
1239
1255
|
type: 'text',
|
|
@@ -1330,7 +1346,7 @@ server.registerTool('write_test_cases', {
|
|
|
1330
1346
|
else {
|
|
1331
1347
|
card = await tp.getUserStory(resourceId);
|
|
1332
1348
|
}
|
|
1333
|
-
if (
|
|
1349
|
+
if (card instanceof Error) {
|
|
1334
1350
|
return {
|
|
1335
1351
|
content: [{
|
|
1336
1352
|
type: 'text',
|
|
@@ -1389,7 +1405,7 @@ server.registerTool('add_test_cases_to_test_plan', {
|
|
|
1389
1405
|
const failed = [];
|
|
1390
1406
|
for (const tc of testCases) {
|
|
1391
1407
|
const testCase = await tp.createTestCase(tc.name, tc.description, String(testPlanId));
|
|
1392
|
-
if (
|
|
1408
|
+
if (testCase instanceof Error) {
|
|
1393
1409
|
failed.push(tc.name);
|
|
1394
1410
|
continue;
|
|
1395
1411
|
}
|
|
@@ -1397,11 +1413,11 @@ server.registerTool('add_test_cases_to_test_plan', {
|
|
|
1397
1413
|
let stepsFailed = 0;
|
|
1398
1414
|
for (const step of tc.steps) {
|
|
1399
1415
|
const stepResult = await tp.addTestStep(String(testCase.Id), step);
|
|
1400
|
-
if (stepResult) {
|
|
1401
|
-
|
|
1416
|
+
if (stepResult instanceof Error) {
|
|
1417
|
+
stepsFailed++;
|
|
1402
1418
|
}
|
|
1403
1419
|
else {
|
|
1404
|
-
|
|
1420
|
+
stepsAdded++;
|
|
1405
1421
|
}
|
|
1406
1422
|
}
|
|
1407
1423
|
created.push({ id: testCase.Id, name: testCase.Name, stepsAdded, stepsFailed });
|
package/build/tp.js
CHANGED
|
@@ -64,7 +64,7 @@ export class TpClient {
|
|
|
64
64
|
catch (error) {
|
|
65
65
|
console.error("Error making TP request:", error);
|
|
66
66
|
console.error("Request URL:", this.redact(_url));
|
|
67
|
-
return
|
|
67
|
+
return error;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
async post(params, data) {
|
|
@@ -85,7 +85,7 @@ export class TpClient {
|
|
|
85
85
|
}
|
|
86
86
|
catch (error) {
|
|
87
87
|
console.error("Error making TP request:", error);
|
|
88
|
-
return
|
|
88
|
+
return error;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
// Like post(), but on failure returns the HTTP status and raw response body
|
|
@@ -149,7 +149,7 @@ export class TpClient {
|
|
|
149
149
|
skip,
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
|
-
if (
|
|
152
|
+
if (page instanceof Error)
|
|
153
153
|
return null;
|
|
154
154
|
if (!page?.Items?.length)
|
|
155
155
|
break;
|
|
@@ -267,6 +267,17 @@ export class TpClient {
|
|
|
267
267
|
param: { "format": "json" },
|
|
268
268
|
}, entity);
|
|
269
269
|
}
|
|
270
|
+
async getUserStoriesInFeatureWithPriority(featureId) {
|
|
271
|
+
return this.get({
|
|
272
|
+
pathParam: ["UserStories"],
|
|
273
|
+
param: {
|
|
274
|
+
"format": "json",
|
|
275
|
+
"where": `(Feature.Id eq ${featureId})`,
|
|
276
|
+
"select": "Id,Name,Priority",
|
|
277
|
+
"take": "200",
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
}
|
|
270
281
|
async updateBug({ id, title, bugContent, origin, releaseId, projectId, teamId, entityStateId, tags, teamIterationId }) {
|
|
271
282
|
const bug = { "Id": id };
|
|
272
283
|
if (title)
|
|
@@ -283,14 +294,15 @@ export class TpClient {
|
|
|
283
294
|
bug["Release"] = { "Id": releaseId };
|
|
284
295
|
if (projectId)
|
|
285
296
|
bug["Project"] = { "Id": projectId };
|
|
286
|
-
if (teamId)
|
|
297
|
+
if (teamId) {
|
|
287
298
|
bug["assignedTeams"] = [{
|
|
288
299
|
"team": {
|
|
289
300
|
"id": teamId || config.tp.teamId
|
|
290
301
|
}
|
|
291
302
|
}];
|
|
303
|
+
}
|
|
292
304
|
if (entityStateId)
|
|
293
|
-
bug["entityState"] = { "
|
|
305
|
+
bug["entityState"] = { "Id": entityStateId };
|
|
294
306
|
if (tags)
|
|
295
307
|
bug["Tags"] = tags;
|
|
296
308
|
if (teamIterationId)
|
|
@@ -1073,7 +1085,7 @@ export class TpClient {
|
|
|
1073
1085
|
const failed = [];
|
|
1074
1086
|
await Promise.all(storyItems.map(async (story) => {
|
|
1075
1087
|
const result = await this.assignRole(String(story.id), userId, roleId);
|
|
1076
|
-
if (result) {
|
|
1088
|
+
if (result && !(result instanceof Error)) {
|
|
1077
1089
|
succeeded.push(result);
|
|
1078
1090
|
}
|
|
1079
1091
|
else {
|