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; } }