DefaultIssue issue = getByKeyForUpdate(session, issueKey).toDefaultIssue();
User user = null;
if (!Strings.isNullOrEmpty(assignee)) {
user = userFinder.findByLogin(assignee);
if (user == null) {
throw new NotFoundException("Unknown user: " + assignee);
}
}
IssueChangeContext context = IssueChangeContext.createUser(new Date(), UserSession.get().login());
if (issueUpdater.assign(issue, user, context)) {
saveIssue(session, issue, context, null);