Exemplo n.º 1
0
 private String getUserFullName(@Nullable String login) {
   if (login == null) {
     return null;
   }
   User user = userFinder.findByLogin(login);
   if (user == null) {
     // most probably user was deleted
     return login;
   }
   return StringUtils.defaultIfBlank(user.name(), login);
 }
Exemplo n.º 2
0
 public boolean assign(DefaultIssue issue, @Nullable User user, IssueChangeContext context) {
   String sanitizedAssignee = null;
   if (user != null) {
     sanitizedAssignee = StringUtils.defaultIfBlank(user.login(), null);
   }
   if (!Objects.equal(sanitizedAssignee, issue.assignee())) {
     String newAssignee = user != null ? user.name() : null;
     issue.setFieldChange(context, ASSIGNEE, UNUSED, newAssignee);
     issue.setAssignee(sanitizedAssignee);
     issue.setUpdateDate(context.date());
     issue.setChanged(true);
     issue.setSendNotifications(true);
     return true;
   }
   return false;
 }