简体   繁体   中英

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?

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"} } ] } }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM