delete_work_item
Remove a work item from DevOps Plan systems by specifying its unique identifier and application name to maintain clean project records.
Instructions
Deletes a work item in Plan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dbid | Yes | The dbid field from the workitem to identify it, this is the first field returned for each workitem in the get_work_items tool. | |
| application | Yes | Name of the application |
Implementation Reference
- old-server.js:540-568 (handler)The handler function that executes the DELETE request to remove a work item.
async ({ dbid, application }) => { try { if (!globalCookies) { globalCookies = await getCookiesFromServer(serverURL); if (!globalCookies) { console.error("Failed to retrieve cookies from server."); return { error: "Failed to retrieve cookies." }; } console.log("Received Cookies:", globalCookies); // Print cookies after receiving } else { console.log("Reusing Stored Cookies:", globalCookies); // Print when reusing stored cookies } const response = await fetch(`${serverURL}/ccmweb/rest/repos/${teamspaceID}/databases/${application}/records/WorkItem/${dbid}?actionName=Delete&useDbid=true`, { method: 'DELETE', headers: { 'Content-Type': 'application/json', 'Authorization': `Basic ${personal_access_token_string}`, 'Cookie': globalCookies } }); if (response.ok) { return { content: [{ type: 'text', text: `Work item ${dbid} deleted successfully` }] }; } else { throw new Error("Failed to delete work item"); } } catch (e) { - old-server.js:533-539 (registration)MCP tool registration for 'delete_work_item'.
server.tool( "delete_work_item", "Deletes a work item in Plan", { dbid: z.string().describe("The dbid field from the workitem to identify it, this is the first field returned for each workitem in the get_work_items tool."), application: z.string().describe("Name of the application") },