@Override public Set<Label> getLabels(final Long issueId) { notNull("issueId", issueId); return labelStore.getLabels(issueId, null); }
@Override public Set<Label> getLabels(final Long issueId, final Long customFieldId) { notNull("issueId", issueId); notNull("customFieldId", customFieldId); return labelStore.getLabels(issueId, customFieldId); }
private Set<Label> setIfNotEqual(final Issue issue, final Set<String> labels, final Long customFieldId, final ApplicationUser remoteUser, final boolean sendNotification,final boolean causesChangeNotification) { Set<Label> oldLabels = labelStore.getLabels(issue.getId(), customFieldId); if (differentLabels(labels, oldLabels)) { final Set<Label> newLabels = labelStore.setLabels(issue.getId(), customFieldId, labels); // JRADEV-2126 Only create a History entry if you are updating labels after creating the issue // note that if causesChangeNotification is false then the labels manager does not fire any // update events at all, and the index is not reindexed if (causesChangeNotification) { issueUpdated(newLabels, oldLabels, issue, customFieldId, remoteUser, sendNotification); } return newLabels; } else { return oldLabels; } }
private Label addIfNotContains(final Issue issue, final String label, Long customFieldId, final ApplicationUser remoteUser, final boolean sendNotification) { Set<Label> oldLabels = labelStore.getLabels(issue.getId(), customFieldId); if (containsLabel(label, oldLabels)) { return getLabel(label, oldLabels); } else { final Label newLabel = labelStore.addLabel(issue.getId(), customFieldId, label); issueUpdated(newLabel, oldLabels, issue, customFieldId, remoteUser, sendNotification); return newLabel; } }