add_issue_comment
Add comments to Backlog issues to provide updates, share information, or collaborate with team members on project tasks.
Instructions
Adds a comment to an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | No | The numeric ID of the issue (e.g., 12345) | |
| issueKey | No | The key of the issue (e.g., 'PROJ-123') | |
| content | Yes | Comment content | |
| notifiedUserId | No | User IDs to notify | |
| attachmentId | No | Attachment IDs |
Implementation Reference
- src/tools/addIssueComment.ts:54-70 (handler)The asynchronous handler function that resolves the issue identifier and posts a comment to the issue using the Backlog client, including optional notified users and attachments.handler: async ({ issueId, issueKey, content, notifiedUserId, attachmentId, }) => { const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t); if (!result.ok) { throw result.error; } return backlog.postIssueComments(result.value, { content, notifiedUserId, attachmentId, }); },
- src/tools/addIssueComment.ts:8-37 (schema)Zod schema defining the input parameters for the add_issue_comment tool: optional issue ID or key, required content, optional notified user IDs and attachment IDs.const addIssueCommentSchema = buildToolSchema((t) => ({ issueId: z .number() .optional() .describe( t( 'TOOL_ADD_ISSUE_COMMENT_ID', 'The numeric ID of the issue (e.g., 12345)' ) ), issueKey: z .string() .optional() .describe( t('TOOL_ADD_ISSUE_COMMENT_KEY', "The key of the issue (e.g., 'PROJ-123')") ), content: z .string() .describe(t('TOOL_ADD_ISSUE_COMMENT_CONTENT', 'Comment content')), notifiedUserId: z .array(z.number()) .optional() .describe( t('TOOL_ADD_ISSUE_COMMENT_NOTIFIED_USER_ID', 'User IDs to notify') ), attachmentId: z .array(z.number()) .optional() .describe(t('TOOL_ADD_ISSUE_COMMENT_ATTACHMENT_ID', 'Attachment IDs')), }));
- src/tools/tools.ts:100-100 (registration)Instantiation and registration of the addIssueCommentTool within the 'issue' toolset group in the allTools export.addIssueCommentTool(backlog, helper),
- src/tools/addIssueComment.ts:52-53 (schema)Tool schema (input wrapped in z.object) and output schema reference.schema: z.object(addIssueCommentSchema(t)), outputSchema: IssueCommentSchema,
- src/tools/addIssueComment.ts:39-72 (registration)Factory function exporting the complete ToolDefinition for 'add_issue_comment', including name, description, schemas, and handler.export const addIssueCommentTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof addIssueCommentSchema>, (typeof IssueCommentSchema)['shape'] > => { return { name: 'add_issue_comment', description: t( 'TOOL_ADD_ISSUE_COMMENT_DESCRIPTION', 'Adds a comment to an issue' ), schema: z.object(addIssueCommentSchema(t)), outputSchema: IssueCommentSchema, handler: async ({ issueId, issueKey, content, notifiedUserId, attachmentId, }) => { const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t); if (!result.ok) { throw result.error; } return backlog.postIssueComments(result.value, { content, notifiedUserId, attachmentId, }); }, }; };