Skip to content

Conversation

danhellem
Copy link
Contributor

@danhellem danhellem commented Jul 29, 2025

Added tool and tests to remove a link from a work item in batch. Meaning you can remove several links at once.

GitHub issue number #132

Associated Risks

N/A

PR Checklist

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • Title of the pull request is clear and informative.
  • 👌 Code hygiene
  • 🔭 Telemetry added, updated, or N/A
  • 📄 Documentation added, updated, or N/A
  • 🛡️ Automated tests added, or N/A

🧪 How did you test it?

Added all new automated tests and tested manually. Will post video and prompts in follow-up commits or PR

@danhellem danhellem requested a review from a team as a code owner July 29, 2025 19:35
@danhellem danhellem requested review from polatengin and Copilot July 29, 2025 19:35
Copy link

github-actions bot commented Jul 29, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@danhellem danhellem linked an issue Jul 29, 2025 that may be closed by this pull request
@danhellem danhellem self-assigned this Jul 29, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to remove links from Azure DevOps work items by implementing a new work_item_unlink tool. The tool allows batch removal of links from a single work item, supporting removal by specific URL or all links of a given type.

Key changes:

  • Added wit_work_item_unlink tool with comprehensive link removal capabilities
  • Extended link type mapping to include "artifact" links
  • Comprehensive test suite covering various scenarios including error handling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/tools/workitems.ts Implements the new work_item_unlink tool with batch link removal functionality and adds "artifact" link type support
test/src/tools/workitems.test.ts Comprehensive test suite for the new unlink tool covering success cases, edge cases, and error scenarios
README.md Documents the new wit_work_item_unlink tool in the available tools list

@danhellem danhellem added the Waiting for Merge 🚘 waiting for pull request to merge label Jul 29, 2025
Copy link

@w090wzj0B0w w090wzj0B0w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mi0r

path: `/relations/${idx}`,
}));

const updatedWorkItem = await workItemApi.updateWorkItem(null, apiUpdates, id, project);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

145

JSON.stringify(updatedWorkItem, null, 2),
},
],
isError: false,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nori

@@ -1468,6 +1468,400 @@ describe("configureWorkItemTools", () => {
});
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wriht tight

},
{
rel: "System.LinkTypes.Related",
url: "https://dev.azure.com/contoso/_apis/wit/workItems/3",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silikonz

@danhellem danhellem merged commit 62458e4 into main Jul 31, 2025
7 checks passed
@danhellem danhellem deleted the users/danhellem/unlinking-1 branch July 31, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for Merge 🚘 waiting for pull request to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the work_items_link tool to support unlinking as well
3 participants