Update Issue
update_issueModify existing MantisBT issue fields like status, priority, or description using partial updates to track bug resolution progress.
Instructions
Update one or more fields of an existing MantisBT issue using a partial PATCH.
The "fields" object accepts any combination of:
summary (string)
description (string)
steps_to_reproduce (string)
additional_information (string)
status: { name: "new"|"feedback"|"acknowledged"|"confirmed"|"assigned"|"resolved"|"closed" }
resolution: { id: 20 } (20 = fixed/resolved)
handler: { id: <user_id> } or { name: "" }
priority: { name: "<priority_name>" }
severity: { name: "<severity_name>" }
reproducibility: { name: "<reproducibility_name>" }
category: { name: "<category_name>" }
version: { name: "<version_name>" } (affected version)
target_version: { name: "<version_name>" }
fixed_in_version: { name: "<version_name>" }
view_state: { name: "public"|"private" }
Important: when resolving an issue, always set BOTH status and resolution to avoid leaving resolution as "open".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Numeric issue ID to update | |
| dry_run | No | If true, return the patch payload that would be sent without actually updating the issue. Useful for previewing changes before committing them. | |
| fields | Yes | Fields to update (partial update — only provided fields are changed; unknown keys are rejected) |
Implementation Reference
- src/tools/issues.ts:395-476 (handler)The handler for the 'update_issue' MCP tool.
server.registerTool( 'update_issue', { title: 'Update Issue', description: `Update one or more fields of an existing MantisBT issue using a partial PATCH. The "fields" object accepts any combination of: - summary (string) - description (string) - steps_to_reproduce (string) - additional_information (string) - status: { name: "new"|"feedback"|"acknowledged"|"confirmed"|"assigned"|"resolved"|"closed" } - resolution: { id: 20 } (20 = fixed/resolved) - handler: { id: <user_id> } or { name: "<username>" } - priority: { name: "<priority_name>" } - severity: { name: "<severity_name>" } - reproducibility: { name: "<reproducibility_name>" } - category: { name: "<category_name>" } - version: { name: "<version_name>" } (affected version) - target_version: { name: "<version_name>" } - fixed_in_version: { name: "<version_name>" } - view_state: { name: "public"|"private" } Important: when resolving an issue, always set BOTH status and resolution to avoid leaving resolution as "open".`, inputSchema: z.object({ id: z.coerce.number().int().positive().describe('Numeric issue ID to update'), dry_run: z.preprocess(coerceBool, z.boolean().optional()).describe('If true, return the patch payload that would be sent without actually updating the issue. Useful for previewing changes before committing them.'), fields: z.preprocess( (v) => { if (typeof v !== 'string') return v; try { return JSON.parse(v); } catch { return v; } }, z.object({ summary: z.string().optional(), description: z.string().optional(), steps_to_reproduce: z.string().optional(), additional_information: z.string().optional(), status: ref.optional(), resolution: ref.optional(), priority: ref.optional(), severity: ref.optional(), reproducibility: ref.optional(), handler: ref.optional(), category: ref.optional(), version: ref.optional(), target_version: ref.optional(), fixed_in_version: ref.optional(), view_state: ref.optional(), }).strict().describe('Fields to update (partial update — only provided fields are changed; unknown keys are rejected)') ), }), annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, }, }, async ({ id, fields, dry_run }) => { if (dry_run) { return { content: [{ type: 'text', text: JSON.stringify({ dry_run: true, id, would_patch: fields }, null, 2) }], }; } try { const patch: Record<string, unknown> = { ...fields }; for (const field of ['status', 'priority', 'severity', 'resolution', 'reproducibility'] as const) { const val = (fields as Record<string, { id?: number; name?: string } | undefined>)[field]; if (val?.name !== undefined && val.id === undefined) { const resolved = await resolveEnum(field, val.name, client); if (typeof resolved !== 'string') patch[field] = resolved; } } const result = await client.patch<{ issue: MantisIssue }>(`issues/${id}`, patch); return { content: [{ type: 'text', text: JSON.stringify(result.issue ?? result, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } ); - src/tools/issues.ts:395-451 (registration)Registration and schema definition for the 'update_issue' tool.
server.registerTool( 'update_issue', { title: 'Update Issue', description: `Update one or more fields of an existing MantisBT issue using a partial PATCH. The "fields" object accepts any combination of: - summary (string) - description (string) - steps_to_reproduce (string) - additional_information (string) - status: { name: "new"|"feedback"|"acknowledged"|"confirmed"|"assigned"|"resolved"|"closed" } - resolution: { id: 20 } (20 = fixed/resolved) - handler: { id: <user_id> } or { name: "<username>" } - priority: { name: "<priority_name>" } - severity: { name: "<severity_name>" } - reproducibility: { name: "<reproducibility_name>" } - category: { name: "<category_name>" } - version: { name: "<version_name>" } (affected version) - target_version: { name: "<version_name>" } - fixed_in_version: { name: "<version_name>" } - view_state: { name: "public"|"private" } Important: when resolving an issue, always set BOTH status and resolution to avoid leaving resolution as "open".`, inputSchema: z.object({ id: z.coerce.number().int().positive().describe('Numeric issue ID to update'), dry_run: z.preprocess(coerceBool, z.boolean().optional()).describe('If true, return the patch payload that would be sent without actually updating the issue. Useful for previewing changes before committing them.'), fields: z.preprocess( (v) => { if (typeof v !== 'string') return v; try { return JSON.parse(v); } catch { return v; } }, z.object({ summary: z.string().optional(), description: z.string().optional(), steps_to_reproduce: z.string().optional(), additional_information: z.string().optional(), status: ref.optional(), resolution: ref.optional(), priority: ref.optional(), severity: ref.optional(), reproducibility: ref.optional(), handler: ref.optional(), category: ref.optional(), version: ref.optional(), target_version: ref.optional(), fixed_in_version: ref.optional(), view_state: ref.optional(), }).strict().describe('Fields to update (partial update — only provided fields are changed; unknown keys are rejected)') ), }), annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, }, },