create_item
Create new work items in Codebeamer trackers by specifying tracker ID, name, description, status, priority, assignments, and other fields. Use get_tracker to discover available options before creating items.
Instructions
Create a new work item in a Codebeamer tracker. Use get_tracker to discover available fields, statuses, and priorities. Returns the created item with all fields.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trackerId | Yes | Numeric tracker ID to create the item in | |
| name | Yes | Item summary / title | |
| description | No | Item description (plain text or wiki markup) | |
| statusId | No | Status ID (use get_tracker to see available statuses) | |
| priorityId | No | Priority ID (use get_tracker to see available priorities) | |
| assignedToIds | No | Array of user IDs to assign | |
| storyPoints | No | Story points estimate | |
| isFolder | No | Set to true to create a folder item instead of a regular item | |
| itemTypeName | No | Item type name as configured in the tracker (e.g. 'Folder', 'Informative'). Overrides isFolder. | |
| parentId | No | Parent item ID to nest this item inside (e.g. a folder) |
Implementation Reference
- src/tools/item-write.ts:14-70 (registration)Registration of the "create_item" tool with its input schema definition.
server.registerTool( "create_item", { title: "Create Item", description: "Create a new work item in a Codebeamer tracker. " + "Use get_tracker to discover available fields, statuses, and priorities. " + "Returns the created item with all fields.", inputSchema: { trackerId: z .number() .int() .positive() .describe("Numeric tracker ID to create the item in"), name: z.string().min(1).describe("Item summary / title"), description: z .string() .optional() .describe("Item description (plain text or wiki markup)"), statusId: z .number() .int() .positive() .optional() .describe("Status ID (use get_tracker to see available statuses)"), priorityId: z .number() .int() .positive() .optional() .describe("Priority ID (use get_tracker to see available priorities)"), assignedToIds: z .array(z.number().int().positive()) .optional() .describe("Array of user IDs to assign"), storyPoints: z .number() .int() .min(0) .optional() .describe("Story points estimate"), isFolder: z .boolean() .optional() .describe("Set to true to create a folder item instead of a regular item"), itemTypeName: z .string() .optional() .describe("Item type name as configured in the tracker (e.g. 'Folder', 'Informative'). Overrides isFolder."), parentId: z .number() .int() .positive() .optional() .describe("Parent item ID to nest this item inside (e.g. a folder)"), }, }, - src/tools/item-write.ts:71-90 (handler)The handler function for "create_item" which prepares the request data and calls the client.
async ({ trackerId, name, description, statusId, priorityId, assignedToIds, storyPoints, isFolder, itemTypeName, parentId }) => { const data: CbCreateItemRequest = { name }; const desiredType = itemTypeName ?? (isFolder ? "Folder" : undefined); if (desiredType) { const schema = await client.getTrackerSchema(trackerId); const typeField = schema.find((f) => f.trackerItemField === "categories" || f.legacyRestName === "type"); const option = typeField?.options?.find((o) => o.name.toLowerCase() === desiredType.toLowerCase()); if (option) { data.categories = [{ id: option.id, type: "ChoiceOptionReference" }]; } } 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.createItem(trackerId, data, parentId); return { content: [{ type: "text", text: formatItem(item) }] }; },