Interface ManagedConfigurationItemService
- All Known Implementing Classes:
DefaultManagedConfigurationItemService
There are a few different states a ManagedConfigurationItem can be in. These are determined by the properties
ManagedConfigurationItem.isManaged() and ManagedConfigurationItem.getConfigurationItemAccessLevel():
isManaged() == true- this item is being managed by JIRA or a plugingetConfigurationItemAccessLevel()- if an item is managed, this property determines who can edit the item. SeeConfigurationItemAccessLevelfor more information.
For a list of which JIRA configuration items can be managed, see ManagedConfigurationItemType.
Each configuration item can only have one ManagedConfigurationItem describing it.
- Since:
- v5.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDenotes the prefix used in theManagedConfigurationItem.getSourceId()field when items are managed by a plugin. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoesUserHavePermission(ApplicationUser user, ConfigurationItemAccessLevel configurationItemAccessLevel) Determine if the specifiedApplicationUserwould have permission to edit anManagedConfigurationItemwith the specified level.booleanDetermine if the specifiedApplicationUserwould have permission to edit theManagedConfigurationItem.Retrieves all of theManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).getManagedCustomField(CustomField customField) Given theCustomField, attempt to retrieve theManagedConfigurationItemthat describes it.getManagedWorkflow(JiraWorkflow workflow) Given theJiraWorkflow, attempt to retrieve theManagedConfigurationItemthat describes it.getManagedWorkflowScheme(WorkflowScheme workflowScheme) Given theWorkflowScheme, attempt to retrieve theManagedConfigurationItemthat describes it.getManagedWorkflowScheme(Long schemeId) Given the workflow scheme ID, attempt to retrieve theManagedConfigurationItemthat describes it.Remove the registration of thisManagedConfigurationItem.Update the registration of thisManagedConfigurationItem.
-
Field Details
-
SOURCE_PREFIX_PLUGIN
Denotes the prefix used in theManagedConfigurationItem.getSourceId()field when items are managed by a plugin.- See Also:
-
-
Method Details
-
getManagedCustomField
Given theCustomField, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a JIRA custom field and the plugin is disabled) then the item can not be considered managed.
- Parameters:
customField- the custom field- Returns:
- the item's representation
-
getManagedWorkflow
Given theJiraWorkflow, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a workflow and the plugin is disabled) then the item can not be considered managed.
- Parameters:
workflow- the workflow- Returns:
- the item's representation
-
getManagedWorkflowScheme
Given theWorkflowScheme, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a workflow scheme and the plugin is disabled) then the item can not be considered managed.
- Parameters:
workflowScheme- the workflow scheme- Returns:
- the item's representation
- See Also:
-
getManagedWorkflowScheme
Given the workflow scheme ID, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a workflow scheme and the plugin is disabled) then the item can not be considered managed.
- Parameters:
schemeId- the workflow scheme ID- Returns:
- the item's representation
- See Also:
-
updateManagedConfigurationItem
@Nonnull ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem(@Nonnull ManagedConfigurationItem item) Update the registration of thisManagedConfigurationItem. If the item was not previously managed, it will now be managed.- Parameters:
item- the item to manage- Returns:
- the result; errors if saving the item failed
-
removeManagedConfigurationItem
@Nonnull ServiceOutcome<Void> removeManagedConfigurationItem(@Nonnull ManagedConfigurationItem item) Remove the registration of thisManagedConfigurationItem. If the item was not previously managed, an error will be returned.- Parameters:
item- the item to stop managing- Returns:
- the result; errors if saving the item failed
-
getManagedConfigurationItems
@Nonnull Collection<ManagedConfigurationItem> getManagedConfigurationItems(@Nonnull ManagedConfigurationItemType type) Retrieves all of theManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).- Parameters:
type- the type to retrieve- Returns:
- the items
-
doesUserHavePermission
Determine if the specifiedApplicationUserwould have permission to edit theManagedConfigurationItem.- Parameters:
user- the useritem- the item- Returns:
- the result
-
doesUserHavePermission
boolean doesUserHavePermission(ApplicationUser user, @Nonnull ConfigurationItemAccessLevel configurationItemAccessLevel) Determine if the specifiedApplicationUserwould have permission to edit anManagedConfigurationItemwith the specified level.- Parameters:
user- the userconfigurationItemAccessLevel- the level- Returns:
- the result
-