class IssueManager {

    @Transactional(propagation = Propagation.REQUIRED)
    public Issue createIssue(IssueVO issueVO) {
        validateIssueParameters(issueVO);

        EntityVO entityVO = issueVO.getEntity();
        validateEntityParameters(entityVO);
        AbstractSecuredEntity entity = ensureEntityExists(entityVO);
        validateEntityCanBeModified(entityVO);

        Issue issue = issueMapper.toIssue(issueVO);
        issue.setAuthor(authManager.getAuthorizedUser());
        issueDao.createIssue(issue);

        issueVO.getAttachments().forEach(a -> attachmentDao.updateAttachmentIssueId(a.getId(), issue.getId()));

        notificationManager.notifyIssue(issue, entity,
                                        StringUtils.defaultIfBlank(issueVO.getHtmlText(), issue.getText()));

        return issue;
    }

}