private void performAddOperation(CommentJsonBean commentJson, IssueInputParameters parameters, ErrorCollection errors) { parameters.getActionParameters().put(CommentSystemField.CREATE_COMMENT, new String[] { "true" }); final List<String> commentParams = new ArrayList<String>(); commentParams.add(commentJson.getBody()); parameters.getActionParameters().put(IssueFieldConstants.COMMENT, commentParams.toArray(new String[commentParams.size()])); }
private void validateCommentBody(CommentJsonBean commentBean) { if (commentBean.getBody() != null) { SimpleErrorCollection errorCollection = new SimpleErrorCollection(); commentService.isValidCommentBody(commentBean.getBody(), errorCollection); if (errorCollection.hasAnyErrors()) { throw new RESTException(Response.Status.BAD_REQUEST, ErrorCollection.of(errorCollection)); } } }
private void validateVisibilityGroup(Issue fromIssue, CommentJsonBean commentBean, VisibilityJsonBean visibility) { if (visibility.type == VisibilityJsonBean.VisibilityType.group) { if (visibility.value == null) { throw new NotFoundWebException(ErrorCollection.of(i18n.getText("rest.comment.visibility.no.value"))); } SimpleErrorCollection errorCollection = new SimpleErrorCollection(); commentService.isValidAllCommentData(authContext.getUser(), fromIssue, commentBean.getBody(), visibility.value, null /* must be null if we specify a group */, errorCollection); if (errorCollection.hasAnyErrors()) { throw new RESTException(Response.Status.BAD_REQUEST, ErrorCollection.of(errorCollection)); } } }
.body(request.getBody()) .commentProperties(getCommentProperties(request.getProperties())) .visibility(visibility)
.body(request.getBody()) .commentProperties(getCommentProperties(request.getProperties())) .visibility(commentVisibility)
if (commentBean != null && commentBean.getBody() != null)