Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/tools/work-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ function getLinkTypeFromName(name: string) {
return "Microsoft.VSTS.Common.Affects-Forward";
case "affected by":
return "Microsoft.VSTS.Common.Affects-Reverse";
case "has dependent":
return "Microsoft.VSTS.Common.Dependent-Forward";
case "dependent on":
return "Microsoft.VSTS.Common.Dependent-Reverse";
case "artifact":
return "ArtifactLink";
default:
Expand Down Expand Up @@ -913,10 +917,10 @@ function configureWorkItemTools(server: McpServer, tokenProvider: () => Promise<
id: z.number().describe("The ID of the work item to update."),
linkToId: z.number().describe("The ID of the work item to link to."),
type: z
.enum(["parent", "child", "duplicate", "duplicate of", "related", "successor", "predecessor", "tested by", "tests", "affects", "affected by"])
.enum(["parent", "child", "duplicate", "duplicate of", "related", "successor", "predecessor", "tested by", "tests", "affects", "affected by", "has dependent", "dependent on"])
.default("related")
.describe(
"Type of link to create between the work items. Options include 'parent', 'child', 'duplicate', 'duplicate of', 'related', 'successor', 'predecessor', 'tested by', 'tests', 'affects', and 'affected by'. Defaults to 'related'."
"Type of link to create between the work items. Options include 'parent', 'child', 'duplicate', 'duplicate of', 'related', 'successor', 'predecessor', 'tested by', 'tests', 'affects', 'affected by', 'has dependent', and 'dependent on'. Defaults to 'related'."
),
comment: z.string().optional().describe("Optional comment to include with the link. This can be used to provide additional context for the link being created."),
})
Expand Down Expand Up @@ -989,10 +993,10 @@ function configureWorkItemTools(server: McpServer, tokenProvider: () => Promise<
project: z.string().describe("The name or ID of the Azure DevOps project."),
id: z.number().describe("The ID of the work item to remove the links from."),
type: z
.enum(["parent", "child", "duplicate", "duplicate of", "related", "successor", "predecessor", "tested by", "tests", "affects", "affected by", "artifact"])
.enum(["parent", "child", "duplicate", "duplicate of", "related", "successor", "predecessor", "tested by", "tests", "affects", "affected by", "has dependent", "dependent on", "artifact"])
.default("related")
.describe(
"Type of link to remove. Options include 'parent', 'child', 'duplicate', 'duplicate of', 'related', 'successor', 'predecessor', 'tested by', 'tests', 'affects', 'affected by', and 'artifact'. Defaults to 'related'."
"Type of link to remove. Options include 'parent', 'child', 'duplicate', 'duplicate of', 'related', 'successor', 'predecessor', 'tested by', 'tests', 'affects', 'affected by', 'has dependent', 'dependent on', and 'artifact'. Defaults to 'related'."
),
url: z.string().optional().describe("Optional URL to match for the link to remove. If not provided, all links of the specified type will be removed."),
},
Expand Down
17 changes: 15 additions & 2 deletions test/src/tools/work-items.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ describe("configureWorkItemTools", () => {
});

// Test different link types to cover all branches in getLinkTypeFromName
const linkTypes = ["parent", "child", "duplicate", "duplicate of", "related", "successor", "predecessor", "tested by", "tests", "affects", "affected by"];
const linkTypes = ["parent", "child", "duplicate", "duplicate of", "related", "successor", "predecessor", "tested by", "tests", "affects", "affected by", "has dependent", "dependent on"];

for (const linkType of linkTypes) {
const params = {
Expand All @@ -1482,7 +1482,20 @@ describe("configureWorkItemTools", () => {
{
id: 1,
linkToId: 2,
type: linkType as "parent" | "child" | "duplicate" | "duplicate of" | "related" | "successor" | "predecessor" | "tested by" | "tests" | "affects" | "affected by",
type: linkType as
| "parent"
| "child"
| "duplicate"
| "duplicate of"
| "related"
| "successor"
| "predecessor"
| "tested by"
| "tests"
| "affects"
| "affected by"
| "has dependent"
| "dependent on",
comment: "Test comment",
},
],
Expand Down
Loading