@Override public LabelsResult addLabel(final ApplicationUser user, final AddLabelValidationResult result, final boolean sendNotification) { notNull("result", result); if (!result.isValid()) { throw new IllegalStateException("Cannot add label with invalid validation result!"); } if (result.getCustomFieldId() != null) { labelManager.addLabel(user, result.getIssueId(), result.getCustomFieldId(), result.getLabel().trim(), sendNotification); return getLabels(user, result.getIssueId(), result.getCustomFieldId()); } else { labelManager.addLabel(user, result.getIssueId(), result.getLabel(), sendNotification); return getLabels(user, result.getIssueId()); } }