jira_add_comment
Add a comment to a JIRA issue by specifying the issue key and comment text, enabling AI assistants to interact with JIRA APIs through the JIRA MCP Server.
Instructions
Add a comment to a JIRA issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment | Yes | Comment text | |
| issueKey | Yes | The JIRA issue key |
Implementation Reference
- server.js:383-401 (handler)The tool handler function that adds a comment to the specified JIRA issue using jiraClient.addComment. It logs the action, handles errors, and returns the added comment as a JSON-formatted text response.async ({ issueKey, comment }) => { logger.info('Adding comment to JIRA issue', { issueKey }); try { const addedComment = await jiraClient.addComment(issueKey, comment); logger.info('Successfully added comment', { issueKey, commentId: addedComment.id }); return { content: [{ type: 'text', text: JSON.stringify(addedComment, null, 2) }] }; } catch (error) { logger.error('Failed to add comment', { issueKey, error: error.message }); throw error; } }
- server.js:378-381 (schema)Input schema for the jira_add_comment tool, defining 'issueKey' and 'comment' parameters using Zod validation.inputSchema: { issueKey: z.string().describe('The JIRA issue key'), comment: z.string().describe('Comment text') }
- server.js:373-402 (registration)Registration of the jira_add_comment tool with server.registerTool, including title, description, input schema, and inline handler function.server.registerTool( 'jira_add_comment', { title: 'Add JIRA Comment', description: 'Add a comment to a JIRA issue', inputSchema: { issueKey: z.string().describe('The JIRA issue key'), comment: z.string().describe('Comment text') } }, async ({ issueKey, comment }) => { logger.info('Adding comment to JIRA issue', { issueKey }); try { const addedComment = await jiraClient.addComment(issueKey, comment); logger.info('Successfully added comment', { issueKey, commentId: addedComment.id }); return { content: [{ type: 'text', text: JSON.stringify(addedComment, null, 2) }] }; } catch (error) { logger.error('Failed to add comment', { issueKey, error: error.message }); throw error; } } );