Any help on this will be really appreciated. Thanks in advance.
As per my understanding we dont have API to add task comments to existing task. But you can add it while creating task using AddTaskCommand which we can execute through /execute REST endpoint.
TaskDataImpl taskData = new TaskDataImpl();
List<Comment> comments = new ArrayList<Comment>();
CommentImpl comment = new CommentImpl();
Hope it helps.
You can add, delete & getallcomments for a task using executor as below:
org.kie.api.task.TaskService taskService = runtimeEngine.getTaskService();
taskService.execute(new AddCommentCommand(taskId, comment));
taskService.execute(new DeleteCommentCommand(taskId, comment));
Hope this helps!!