private void cloneAttachmentsIfNeeded(Issue clone) throws CreateException { /* * Note, that Create Attachment permission is not checked, * the same way Link Issue permission is not checked for cloning links. */ if (isCloneAttachments() && attachmentManager.attachmentsEnabled()) { Map<Long, Either<AttachmentError, Attachment>> result = attachmentManager.copyAttachments(originalIssue, getLoggedInUser(), clone.getKey()); for (final Either<AttachmentError, Attachment> either : result.values()) { if (either.isLeft()) { final AttachmentError error = either.left().get(); log.warn(error.getLogMessage(), error.getException().getOrNull()); } } } }