@SuppressWarnings({"unchecked"}) private List<User> fromEventParams(IssueEvent event, String customFieldId) { Map<String, Object> customFieldValues = (Map) event.getParams().get(IssueEvent.CUSTOM_FIELDS_PARAM_NAME); if (customFieldValues != null) { Object rawValue = customFieldValues.get(customFieldId); return rawValue != null ? Lists.newArrayList(groupSelectorUtils.getUsers(rawValue)) : null; } else { return null; } }
@SuppressWarnings({"unchecked"}) private List<User> fromIssue(IssueEvent event, String customFieldId) { try { return Lists.newArrayList(groupSelectorUtils.getUsers(event.getIssue(), customFieldId)); } catch (IllegalArgumentException e) { // JRA-14392: This shouldn't happen any longer, however there may still be some old invalid // data that could // cause this. log.warn( "Returning empty list of e-mail recipients. Please remove any invalid custom " + "fields from your notification schemes.", e); return Collections.emptyList(); } }
/** * Used in the UI layer. * * @return list of group-related custom fields */ public List getFields() { return groupSelectorUtils.getCustomFieldsSpecifyingGroups(); }