Update Item
update_itemUpdate specific fields on an existing Codebeamer work item by providing only the fields to change. Returns the complete updated item.
Instructions
Update fields on an existing Codebeamer work item. Only provide the fields you want to change. Returns the updated item with all fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | Numeric item ID to update | |
| name | No | New summary / title | |
| description | No | New description (plain text or wiki markup) | |
| statusId | No | New status ID | |
| priorityId | No | New priority ID | |
| assignedToIds | No | New array of assigned user IDs (replaces current) | |
| storyPoints | No | New story points estimate |
Implementation Reference
- src/tools/item-write.ts:136-147 (handler)The handler function for the update_item tool. Takes itemId and optional fields, builds a CbUpdateItemRequest, and calls client.updateItem(). Returns formatted item content.
async ({ itemId, name, description, statusId, priorityId, assignedToIds, storyPoints }) => { const data: CbUpdateItemRequest = {}; if (name !== undefined) data.name = name; if (description !== undefined) data.description = description; if (statusId !== undefined) data.status = { id: statusId }; if (priorityId !== undefined) data.priority = { id: priorityId }; if (assignedToIds !== undefined) data.assignedTo = assignedToIds.map((id) => ({ id })); if (storyPoints !== undefined) data.storyPoints = storyPoints; const item = await client.updateItem(itemId, data); return { content: [{ type: "text", text: formatItem(item) }] }; }, - src/tools/item-write.ts:101-134 (schema)Input schema for the update_item tool defining all optional fields (itemId required, name, description, statusId, priorityId, assignedToIds, storyPoints optional).
inputSchema: { itemId: z .number() .int() .positive() .describe("Numeric item ID to update"), name: z.string().min(1).optional().describe("New summary / title"), description: z .string() .optional() .describe("New description (plain text or wiki markup)"), statusId: z .number() .int() .positive() .optional() .describe("New status ID"), priorityId: z .number() .int() .positive() .optional() .describe("New priority ID"), assignedToIds: z .array(z.number().int().positive()) .optional() .describe("New array of assigned user IDs (replaces current)"), storyPoints: z .number() .int() .min(0) .optional() .describe("New story points estimate"), }, - src/tools/item-write.ts:93-148 (registration)Registration of the update_item tool via server.registerTool(). The tool is registered inside registerItemWriteTools().
server.registerTool( "update_item", { title: "Update Item", description: "Update fields on an existing Codebeamer work item. " + "Only provide the fields you want to change. " + "Returns the updated item with all fields.", inputSchema: { itemId: z .number() .int() .positive() .describe("Numeric item ID to update"), name: z.string().min(1).optional().describe("New summary / title"), description: z .string() .optional() .describe("New description (plain text or wiki markup)"), statusId: z .number() .int() .positive() .optional() .describe("New status ID"), priorityId: z .number() .int() .positive() .optional() .describe("New priority ID"), assignedToIds: z .array(z.number().int().positive()) .optional() .describe("New array of assigned user IDs (replaces current)"), storyPoints: z .number() .int() .min(0) .optional() .describe("New story points estimate"), }, }, async ({ itemId, name, description, statusId, priorityId, assignedToIds, storyPoints }) => { const data: CbUpdateItemRequest = {}; if (name !== undefined) data.name = name; if (description !== undefined) data.description = description; if (statusId !== undefined) data.status = { id: statusId }; if (priorityId !== undefined) data.priority = { id: priorityId }; if (assignedToIds !== undefined) data.assignedTo = assignedToIds.map((id) => ({ id })); if (storyPoints !== undefined) data.storyPoints = storyPoints; const item = await client.updateItem(itemId, data); return { content: [{ type: "text", text: formatItem(item) }] }; }, ); - The client method updateItem() that sends the PUT request to /items/{itemId} with the request data.
updateItem(itemId: number, data: CbUpdateItemRequest): Promise<CbItem> { return this.http.put(`/items/${itemId}`, { body: data, resource: `update item ${itemId}`, }); } - Type definition for the CbUpdateItemRequest interface with all optional fields: name, description, status, priority, assignedTo, storyPoints, customFields.
export interface CbUpdateItemRequest { name?: string; description?: string; status?: { id: number; type?: string }; priority?: { id: number }; assignedTo?: Array<{ id: number }>; storyPoints?: number; customFields?: Array<{ fieldId: number; type: string; values?: Array<{ id: number; type: string }>; value?: unknown }>; }