update_comment
Update an existing comment on a Jira issue. Supports Markdown for rich formatting and mentions using accountId.
Instructions
Update an existing comment on a Jira issue. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown is automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | The issue key containing the comment | |
| commentId | Yes | The ID of the comment to update | |
| body | Yes | The new comment text. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown will be automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool). | |
| visibility | No | Comment visibility settings |
Implementation Reference
- src/tools/comments.ts:196-207 (handler)Tool handler for 'update_comment' that validates args via schema, calls jiraClient.updateComment(), and returns success message.
case 'update_comment': { const validatedArgs = updateCommentSchema.cast(args); const result = await jiraClient.updateComment(validatedArgs); return { content: [ { type: 'text', text: `Comment ${result.id} updated successfully`, }, ], }; } - src/schemas/index.ts:153-187 (schema)Yup validation schema for update_comment input: requires issueKey, commentId, body (with Markdown-to-ADF conversion), and optional visibility.
export const updateCommentSchema = yup.object({ issueKey: yup.string().required('Issue key is required'), commentId: yup.string().required('Comment ID is required'), body: yup.mixed() .required('Comment body is required') .test('is-string', 'Body must be a string', function (value) { return typeof value === 'string'; }) .transform(function (value) { // If it's a string and looks like markdown, convert to ADF if (typeof value === 'string' && isMarkdown(value)) { return markdownToADF(value); } // For plain text, create a simple ADF paragraph return { version: 1, type: 'doc', content: [ { type: 'paragraph', content: [ { type: 'text', text: value } ] } ] }; }), visibility: yup.object({ type: yup.string().oneOf(['role', 'group']).optional(), value: yup.string().optional(), }).optional().default(undefined), }); - src/tools/comments.ts:73-109 (registration)Tool registration/definition in createCommentTools: name 'update_comment', description, and inputSchema with issueKey, commentId, body, visibility.
{ name: 'update_comment', description: 'Update an existing comment on a Jira issue. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown is automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'The issue key containing the comment', }, commentId: { type: 'string', description: 'The ID of the comment to update', }, body: { type: 'string', description: 'The new comment text. Supports plain text or Markdown for rich formatting (headings, lists, code blocks, links, etc.). Markdown will be automatically converted to ADF. For mentions, use format: @[accountId:displayName] (get accountId from get_users tool).', }, visibility: { type: 'object', properties: { type: { type: 'string', enum: ['role', 'group'], description: 'The visibility type', }, value: { type: 'string', description: 'The role or group name', }, }, description: 'Comment visibility settings', }, }, required: ['issueKey', 'commentId', 'body'], }, },