public class DefaultLabelService extends Object implements LabelService
LabelService.AddLabelValidationResult, LabelService.LabelsResult, LabelService.LabelSuggestionResult, LabelService.LabelValidationResult, LabelService.SetLabelValidationResult
Constructor and Description |
---|
DefaultLabelService(PermissionManager permissionManager,
IssueManager issueManager,
LabelManager labelManager,
I18nHelper.BeanFactory beanFactory,
CustomFieldManager customFieldManager,
FieldLayoutManager fieldLayoutManager) |
Modifier and Type | Method and Description |
---|---|
LabelService.LabelsResult |
addLabel(ApplicationUser user,
LabelService.AddLabelValidationResult result,
boolean sendNotification)
Adds the label to the issue specified by the validation result.
|
LabelService.LabelsResult |
getLabels(ApplicationUser user,
Long issueId)
Returns all the labels for the given issue.
|
LabelService.LabelsResult |
getLabels(ApplicationUser user,
Long issueId,
Long customFieldId)
Returns all the labels for the given issue and custom field.
|
LabelService.LabelSuggestionResult |
getSuggestedLabels(ApplicationUser user,
Long issueId,
Long customFieldId,
String token)
Given a token to search for, this method returns a number of suggestions for the label.
|
LabelService.LabelSuggestionResult |
getSuggestedLabels(ApplicationUser user,
Long issueId,
String token)
Given a token to search for, this method returns a number of suggestions for the label.
|
LabelService.LabelsResult |
setLabels(ApplicationUser user,
LabelService.SetLabelValidationResult result,
boolean sendNotification,
boolean causeChangeNotification)
Sets the labels for a particular issue to the set specified as a parameter.
|
LabelService.AddLabelValidationResult |
validateAddLabel(ApplicationUser user,
Long issueId,
Long customFieldId,
String label)
Validates that the user provided can add the label provided for a particular issue.
|
LabelService.AddLabelValidationResult |
validateAddLabel(ApplicationUser user,
Long issueId,
String label)
Validates that the user provided can add the label provided for a particular issue.
|
LabelService.SetLabelValidationResult |
validateSetLabels(ApplicationUser user,
Long issueId,
Long customFieldId,
Set<String> labels)
Validates that the user provided can set the labels provided for a particular issue.
|
LabelService.SetLabelValidationResult |
validateSetLabels(ApplicationUser user,
Long issueId,
Set<String> labels)
Validates that the user provided can set the labels provided for a particular issue.
|
public DefaultLabelService(PermissionManager permissionManager, IssueManager issueManager, LabelManager labelManager, I18nHelper.BeanFactory beanFactory, CustomFieldManager customFieldManager, FieldLayoutManager fieldLayoutManager)
public LabelService.LabelsResult getLabels(ApplicationUser user, Long issueId)
LabelService
getLabels
in interface LabelService
user
- The user performing the operationissueId
- The issue id that the label is linked againstpublic LabelService.LabelsResult getLabels(ApplicationUser user, Long issueId, Long customFieldId)
LabelService
getLabels
in interface LabelService
user
- The user performing the operationissueId
- The issue id that the label is linked againstcustomFieldId
- Custom field id for the labels CF or null if it's the system field.public LabelService.SetLabelValidationResult validateSetLabels(ApplicationUser user, Long issueId, Set<String> labels)
LabelService
validateSetLabels
in interface LabelService
user
- The user performing the operationissueId
- The issue id of the issue that labels will be set onlabels
- The actual labels as strings to set on the issuepublic LabelService.SetLabelValidationResult validateSetLabels(ApplicationUser user, Long issueId, Long customFieldId, Set<String> labels)
LabelService
validateSetLabels
in interface LabelService
user
- The user performing the operationissueId
- The issue id of the issue that labels will be set oncustomFieldId
- The custom field id against which to set the labelslabels
- The actual labels as strings to set on the issuepublic LabelService.LabelsResult setLabels(ApplicationUser user, LabelService.SetLabelValidationResult result, boolean sendNotification, boolean causeChangeNotification)
LabelService
setLabels
in interface LabelService
user
- The user performing the operationresult
- The validation result obtained by calling LabelService.validateSetLabels(com.atlassian.jira.user.ApplicationUser,
Long, java.util.Set)
sendNotification
- true if a notification e-mail should be sent, false otherwisecauseChangeNotification
- true if a change history should be created, false otherwisepublic LabelService.AddLabelValidationResult validateAddLabel(ApplicationUser user, Long issueId, String label)
LabelService
validateAddLabel
in interface LabelService
user
- The user performing the operationissueId
- The issue id of the issue that labels will be set onlabel
- The actual labels as strings to set on the issuepublic LabelService.AddLabelValidationResult validateAddLabel(ApplicationUser user, Long issueId, Long customFieldId, String label)
LabelService
validateAddLabel
in interface LabelService
user
- The user performing the operationissueId
- The issue id of the issue that labels will be set oncustomFieldId
- Custom field id for the labels CF or null if it's the system field.label
- The actual labels as strings to set on the issuepublic LabelService.LabelsResult addLabel(ApplicationUser user, LabelService.AddLabelValidationResult result, boolean sendNotification)
LabelService
addLabel
in interface LabelService
user
- The user performing the operationresult
- The validation result obtained via LabelService.validateAddLabel(com.atlassian.jira.user.ApplicationUser, Long, String)
sendNotification
- true if a notification e-mail should be sent, false otherwisepublic LabelService.LabelSuggestionResult getSuggestedLabels(ApplicationUser user, Long issueId, String token)
LabelService
getSuggestedLabels
in interface LabelService
user
- The user trying to get label suggestionsissueId
- The issue for which suggestions are being fetched or null
token
- The prefix for the labels to be suggested. May be null for popular label suggestionspublic LabelService.LabelSuggestionResult getSuggestedLabels(ApplicationUser user, Long issueId, Long customFieldId, String token)
LabelService
getSuggestedLabels
in interface LabelService
user
- The user trying to get label suggestionsissueId
- The issue for which suggestions are being fetched or null
customFieldId
- The labels custom field for which to provide suggestionstoken
- The prefix for the labels to be suggested. May be null for popular label suggestionsCopyright © 2002-2019 Atlassian. All Rights Reserved.