edit_ticket
Update Jira ticket details, including summary, description, labels, and parent key, via the /rest/api/3/issue/{issueIdOrKey} API. Simplify ticket management with structured input fields.
Instructions
Edit a ticket on Jira on the api /rest/api/3/issue/{issueIdOrKey}. Do not use markdown in any field.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | The description of the ticket | |
| issueIdOrKey | Yes | The issue id or key | |
| labels | No | The labels of the ticket | |
| parent | No | The key of the parent ticket (the epic) | |
| summary | No | The summary of the ticket |
Implementation Reference
- src/index.ts:587-645 (handler)The core handler function that performs the PUT request to edit a Jira ticket with summary, description, labels, and parent.async function editTicket( issueIdOrKey?: string, summary?: string, description?: string, labels?: string[], parent?: string, ): Promise<any> { try { const descriptionToSend = description || 'No description provided'; const jiraDescription = description === null ? undefined : { type: 'doc', version: 1, content: [ { type: 'paragraph', content: [ { type: 'text', text: descriptionToSend, }, ], }, ], }; const parentToSend = parent ? { key: parent } : undefined; //we create the fields object with only the present fields let fields: any = { summary: summary, labels: labels, parent: parentToSend, }; if (description) { fields['description'] = jiraDescription; } const response = await axios.put( `${JIRA_URL}/rest/api/3/issue/${issueIdOrKey}`, { fields: fields, }, { headers: getAuthHeaders().headers, }, ); return response.data; } catch (error: any) { return { error: error.response.data, }; } }
- src/index.ts:158-189 (schema)The input schema and description for the edit_ticket tool.name: 'edit_ticket', description: 'Edit a ticket on Jira on the api /rest/api/3/issue/{issueIdOrKey}. Do not use markdown in any field.', inputSchema: { type: 'object', properties: { issueIdOrKey: { type: 'string', description: 'The issue id or key', }, summary: { type: 'string', description: 'The summary of the ticket', }, description: { type: 'string', description: 'The description of the ticket', }, labels: { type: 'array', items: { type: 'string', }, description: 'The labels of the ticket', }, parent: { type: 'string', description: 'The key of the parent ticket (the epic)', }, }, required: ['issueIdOrKey'], },
- src/index.ts:839-866 (registration)The dispatch case in the MCP tool request handler that calls the editTicket function and returns the response.case 'edit_ticket': const issueIdOrKey: any = request.params.arguments?.issueIdOrKey; const summary: any = request.params.arguments?.summary; const description: any = request.params.arguments?.description; const labels: any = request.params.arguments?.labels; const parent: any = request.params.arguments?.parent; if (!issueIdOrKey) { throw new Error('Issue id or key is required'); } const response = await editTicket( issueIdOrKey, summary, description, labels, parent, ); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], };