update_status
Change the status of a Jira ticket by specifying the ticket ID and transition ID to move it through workflow stages.
Instructions
Update the status of a Jira ticket
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticketId | Yes | The Jira ticket ID | |
| status | Yes |
Implementation Reference
- src/server.ts:352-374 (handler)The handler function that performs the Jira status update by calling the doTransition API with the provided ticket ID and transition ID. Includes config validation and error handling.async ({ ticketId, status }: { ticketId: string; status: StatusUpdate }) => { const configError = validateJiraConfig(); if (configError) { return { content: [{ type: "text", text: `Configuration error: ${configError}` }], }; } try { await jira.issues.doTransition({ issueIdOrKey: ticketId, transition: { id: status.transitionId }, }); return { content: [{ type: "text", text: `Updated status of ${ticketId}` }], }; } catch (error) { return { content: [{ type: "text", text: `Failed to update status: ${(error as Error).message}` }], }; } }
- src/server.ts:61-63 (schema)Zod schema for validating the 'status' input parameter of the update_status tool.const StatusUpdateSchema = z.object({ transitionId: z.string().describe("The ID of the transition to perform"), });
- src/server.ts:44-46 (schema)TypeScript interface defining the shape of the status update input.interface StatusUpdate { transitionId: string; }
- src/server.ts:345-375 (registration)Registration of the 'update_status' tool on the MCP server, specifying name, description, input schema, and handler function.server.tool( "update_status", "Update the status of a Jira ticket", { ticketId: z.string().describe("The Jira ticket ID"), status: StatusUpdateSchema, }, async ({ ticketId, status }: { ticketId: string; status: StatusUpdate }) => { const configError = validateJiraConfig(); if (configError) { return { content: [{ type: "text", text: `Configuration error: ${configError}` }], }; } try { await jira.issues.doTransition({ issueIdOrKey: ticketId, transition: { id: status.transitionId }, }); return { content: [{ type: "text", text: `Updated status of ${ticketId}` }], }; } catch (error) { return { content: [{ type: "text", text: `Failed to update status: ${(error as Error).message}` }], }; } } );
- src/server.ts:89-95 (helper)Helper function used by the handler to validate Jira configuration environment variables.// Helper function to validate Jira configuration function validateJiraConfig(): string | null { if (!process.env.JIRA_HOST) return "JIRA_HOST environment variable is not set"; if (!process.env.JIRA_EMAIL) return "JIRA_EMAIL environment variable is not set"; if (!process.env.JIRA_API_TOKEN) return "JIRA_API_TOKEN environment variable is not set"; return null; }