Interface ManagedConfigurationItemService

All Known Implementing Classes:
DefaultManagedConfigurationItemService

@PublicApi public interface ManagedConfigurationItemService
This provides an API for plugin developers and for JIRA internally to restrict the administration of certain configuration items. Often, a plugin developer will want to configure JIRA programmatically and rely on that configuration being unchanged. Using this API, the developer can register their desired items as "managed" or "locked" configuration items. This will prevent administrators from changing the configuration and invalidating the plugin's needs.

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 plugin
  • getConfigurationItemAccessLevel() - if an item is managed, this property determines who can edit the item. See ConfigurationItemAccessLevel for 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 Details

  • Method Details

    • getManagedCustomField

      @Nonnull ManagedConfigurationItem getManagedCustomField(@Nonnull CustomField customField)
      Given the CustomField, attempt to retrieve the ManagedConfigurationItem that 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

      @Nonnull ManagedConfigurationItem getManagedWorkflow(@Nonnull JiraWorkflow workflow)
      Given the JiraWorkflow, attempt to retrieve the ManagedConfigurationItem that 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

      @Nonnull ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull WorkflowScheme workflowScheme)
      Given the WorkflowScheme, attempt to retrieve the ManagedConfigurationItem that 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

      @Nonnull ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull Long schemeId)
      Given the workflow scheme ID, attempt to retrieve the ManagedConfigurationItem that 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 this ManagedConfigurationItem. 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 this ManagedConfigurationItem. 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 the ManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).
      Parameters:
      type - the type to retrieve
      Returns:
      the items
    • doesUserHavePermission

      boolean doesUserHavePermission(ApplicationUser user, @Nonnull ManagedConfigurationItem item)
      Determine if the specified ApplicationUser would have permission to edit the ManagedConfigurationItem.
      Parameters:
      user - the user
      item - the item
      Returns:
      the result
    • doesUserHavePermission

      boolean doesUserHavePermission(ApplicationUser user, @Nonnull ConfigurationItemAccessLevel configurationItemAccessLevel)
      Determine if the specified ApplicationUser would have permission to edit an ManagedConfigurationItem with the specified level.
      Parameters:
      user - the user
      configurationItemAccessLevel - the level
      Returns:
      the result