feat: replies to comments
A comment can answer another one (replyTo), one level deep: answering a reply joins the same thread, and it must be on the same ticket. Whoever wrote the comment gets a new REPLIED notification, and the activity says "respondió a un comentario". A comment deleted while it has replies stays, without its text (deleted: true), so the thread still reads; it goes with its last reply and does not count in commentCount. The ticket page shows threads with their replies indented and a "Responder" box; REST, GraphQL and the MCP (add_comment, get_issue) take and show replyTo. Existing comments are unchanged. Docs, Word and PDF updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -224,9 +224,10 @@ export class IssuesResolver {
|
||||
)
|
||||
).items.map((c) => ({
|
||||
id: c.id,
|
||||
author: c.author.name,
|
||||
replyTo: c.replyTo,
|
||||
author: c.deleted ? null : c.author.name,
|
||||
at: c.createdAt,
|
||||
body: c.body,
|
||||
body: c.deleted ? '(deleted; kept for its replies)' : c.body,
|
||||
}))
|
||||
: undefined;
|
||||
const history = params.withHistory
|
||||
@@ -411,19 +412,27 @@ export class IssuesResolver {
|
||||
|
||||
@Tool({
|
||||
name: 'add_comment',
|
||||
description: 'Comment on a ticket (decisions, explanations, steps).',
|
||||
description:
|
||||
'Comment on a ticket (decisions, explanations, steps), or answer a comment with replyTo (one level: answering a reply joins its thread).',
|
||||
paramsSchema: z.object({
|
||||
issue: issueRef,
|
||||
body: z.string().min(1).max(20000),
|
||||
replyTo: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe('Id of the comment it answers (see get_issue)'),
|
||||
}),
|
||||
annotations: WRITE,
|
||||
})
|
||||
comment({ issue, body }: { issue: string; body: string }, ctx: McpContext) {
|
||||
comment(
|
||||
{ issue, body, replyTo }: { issue: string; body: string; replyTo?: string },
|
||||
ctx: McpContext,
|
||||
) {
|
||||
return toolResult(() =>
|
||||
this.api.data(
|
||||
this.api.as(ctx).POST('/api/issues/{issue}/comments', {
|
||||
params: { path: { issue } },
|
||||
body: { body },
|
||||
body: { body, replyTo },
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user