Interface ProjectOrderByManager

All Known Implementing Classes:
DefaultProjectOrderByManager

@PublicApi public interface ProjectOrderByManager
Implementations of this interface are responsible for handling preferred order-by option for project issues
  • Method Details

    • updateProjectPreferredOrderByOption

      void updateProjectPreferredOrderByOption(long projectId, ApplicationUser user, String newOrderByOption) throws PermissionException
      Updates the order-by preferences for issues within a specified project.

      The newOrderByOption specifies the ID of the preferred orderable field. If the newOrderByOption is empty, the preferred order-by option is cleared.

      This method will throw exceptions under the following conditions:

      • If the project is not valid.
      • If the user does not have project administration or admin permissions.
      • If the newOrderByOption is invalid.
      Parameters:
      projectId - the ID of the project for which the order-by preferences will be changed
      user - the user performing the operation
      newOrderByOption - the new preferred order-by option
      Throws:
      PermissionException - if the user lacks the necessary permissions
      IllegalArgumentException - if the project is invalid or the new order-by option is invalid
    • getProjectPreferredOrderByOption

      Optional<String> getProjectPreferredOrderByOption(long projectId, ApplicationUser user) throws PermissionException
      Retrieves the preferred order-by option for issues within a specified project.

      If the project is not valid, this method will throw an exception.

      If the user lacks permission to browse the project, this method will throw a PermissionException.

      Parameters:
      projectId - the ID of the project
      user - the user performing the operation
      Returns:
      an Optional containing the preferred order-by option if available and valid, otherwise Optional.empty()
      Throws:
      PermissionException - if the user does not have permission to browse the project
      IllegalArgumentException - if the project is invalid