ishaan
ishaan

Reputation: 59

How to append new comment to the already existing comment on JIRA using Java

I need to append a new comment to an already existing comment in JIRA using its comment ID in Java. Is it possible to do this?

Upvotes: 0

Views: 882

Answers (1)

Sheetal Mohan Sharma
Sheetal Mohan Sharma

Reputation: 2924

You can try to get the existing comment and update it?

1. GET /rest/api/2/issue/{issue}/comment/{id}

then update

2. POST /rest/api/2/issue/{issue}/comment/{id}

Check notes here in Jira documentation.

Some fields cannot be updated this way (for example, comments). Instead you must use explicit-verb updates (see below). You can tell if a field cannot be implicitly set by the fact it doesn't have a SET verb.

EDIT: Edits an element in a field that is an array. The element is indexed/identified by the value itself (usually by id/name/key).

edit the text of a particular comment:
{ "update": { "comments": [{"edit": {"id": 10002, "body": "newbody"} } ] } }

Upvotes: 1

Related Questions