Package com.atlassian.jira.project
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 Summary
Modifier and TypeMethodDescriptiongetProjectPreferredOrderByOption(long projectId, ApplicationUser user) Retrieves the preferred order-by option for issues within a specified project.voidupdateProjectPreferredOrderByOption(long projectId, ApplicationUser user, String newOrderByOption) Updates the order-by preferences for issues within a specified project.
-
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
newOrderByOptionspecifies the ID of the preferred orderable field. If thenewOrderByOptionis 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
newOrderByOptionis invalid.
- Parameters:
projectId- the ID of the project for which the order-by preferences will be changeduser- the user performing the operationnewOrderByOption- the new preferred order-by option- Throws:
PermissionException- if the user lacks the necessary permissionsIllegalArgumentException- 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 projectuser- the user performing the operation- Returns:
- an
Optionalcontaining the preferred order-by option if available and valid, otherwiseOptional.empty() - Throws:
PermissionException- if the user does not have permission to browse the projectIllegalArgumentException- if the project is invalid
-