@Override public CommentSummary getCommentById(long taskId, long commentId) { return CommentSummaryHelper.adapt(taskService.getCommentById(taskId, commentId)); }
public String getCommentById(String containerId, Number taskId, Number commentId, String marshallingType) { containerId = context.getContainerId(containerId, new ByTaskIdContainerLocator(taskId.longValue())); Comment comment = userTaskService.getCommentById(containerId, taskId.longValue(), commentId.longValue()); if (comment == null) { throw new IllegalStateException("No comment found with id " + commentId + " on task " + taskId); } TaskComment taskComment = TaskComment.builder() .id(comment.getId()) .text(comment.getText()) .addedBy(comment.getAddedBy().getId()) .addedAt(comment.getAddedAt()) .build(); logger.debug("About to marshal task '{}' comment {}", taskId, taskComment); String response = marshallerHelper.marshal(containerId, marshallingType, taskComment); return response; }