jira_add_comment
Add comments to Jira issues with support for markdown, plain text, or ADF format, and optional visibility restrictions for groups or roles.
Instructions
Adds a comment to an issue. Supports visibility restrictions for groups or roles. Comment format is controlled by the "format" parameter (default: markdown). Returns the created comment with author details and timestamp.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | Issue key to add comment to | |
| body | Yes | Comment body text | |
| visibility | No | Comment visibility restrictions | |
| format | No | Comment format: "markdown" (converts Markdown to ADF), "adf" (use as-is ADF object), "plain" (converts plain text to ADF with basic formatting). Default: "markdown" | markdown |
Implementation Reference
- src/tools/add-comment.ts:57-77 (handler)The main handler function that validates input, calls the API helper to add a comment, and formats the response.
export async function handleAddComment(input: unknown): Promise<McpToolResponse> { try { const validated = validateInput(AddCommentInputSchema, input); log.info(`Adding comment to issue ${validated.issueKey}...`); const comment = await addComment( validated.issueKey, validated.body, validated.visibility, validated.format ); log.info(`Added comment to ${validated.issueKey}`); return formatCommentResponse(comment); } catch (error) { log.error('Error in handleAddComment:', error); return handleError(error); } }