Interface RankService

All Known Implementing Classes:
RankServiceImpl

public interface RankService
GreenHopper global ranking service. Allows ranking issues (and other 'rankables') relative to each other. Current permission checks only apply to rankable (issue or otherwise) being ranked, not to the old/new predecessor or successor.
Author:
ahennecke, miruflin
  • Field Details

    • CUSTOM_FIELD_ID_ERROR_CONTEXT

      static final String CUSTOM_FIELD_ID_ERROR_CONTEXT
      See Also:
    • CAN_RANK_PERMISSION

      static final int CAN_RANK_PERMISSION
      Permission used to check whether the user is allowed to rank an issue. The permission applied on the issue the user intents to rerank.
      See Also:
  • Method Details

    • rankBefore

      @Nonnull ServiceOutcome<RankChange> rankBefore(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable, Rankable rankBefore)
      Rank a rankable object before another one.
      Parameters:
      user - : The user performing the rank operation
      rankable - : The rankable to rank
      rankBefore - : The rankable to be ranked before. If this doesn't exist in the index, it will be added at the last position.
    • rankBefore

      @Nonnull ServiceOutcome<RankChangesOutcome> rankBefore(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables, Rankable rankBefore)
      Rank several rankables before another one.
      Parameters:
      user - : The user performing the rank operation
      rankables - : The rankables to rank (in order)
      rankBefore - : The rankable to be ranked before. If this doesn't exist in the index, it will be added at the last position.
    • rankAfter

      @Nonnull ServiceOutcome<RankChange> rankAfter(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable, Rankable rankAfter)
      Rank an rankable after another one.
      Parameters:
      user - : The user performing the rank operation
      rankable - : The rankable to rank
      rankAfter - : The rankable to be ranked after. If this doesn't exist in the index, it will be added at the last position.
    • rankAfter

      @Nonnull ServiceOutcome<RankChangesOutcome> rankAfter(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankables, Rankable rankAfter)
      Rank several rankables after another one.
      Parameters:
      user - : The user performing the rank operation
      rankables - : The rankables to rank (in order)
      rankAfter - : The rankable to be ranked after. If this doesn't exist in the index, it will be added at the last position.
    • rankFirst

      @Nonnull ServiceOutcome<RankChange> rankFirst(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable)
      Rank a rankable first, thus add it as first global rankable.
      Parameters:
      user - : The user performing the rank operation
      rankable - : The rankable to rank
    • rankFirst

      @Nonnull ServiceOutcome<RankChangesOutcome> rankFirst(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankable)
      Rank a rankable first, thus add it as first global rankable.
      Parameters:
      user - : The user performing the rank operation
      rankable - : The rankable to rank
    • rankLast

      @Nonnull ServiceOutcome<RankChange> rankLast(com.atlassian.jira.user.ApplicationUser user, long customFieldId, Rankable rankable)
      Rank a rankable last, thus add it as last global rankable
      Parameters:
      user - : The user performing the rank operation
      rankable - : The rankable to rank
    • rankLast

      @Nonnull ServiceOutcome<RankChangesOutcome> rankLast(com.atlassian.jira.user.ApplicationUser user, long customFieldId, List<Rankable> rankable)
      Rank a rankable last, thus add it as last global rankable
      Parameters:
      user - : The user performing the rank operation
      rankable - : The rankable to rank
    • getRankablePosition

      @Nonnull ServiceOutcome<LexoRank> getRankablePosition(long customFieldId, Rankable rankable)
      Get the position for the given rankable. This is the absolute position in the global index, so it does not have any significance for a particular RapidView except from one showing all rankables in all projects. All that is guaranteed is that rank(a) < rank(b)
      Parameters:
      rankable - : The rankable to rank
    • canRank

      @Nonnull ServiceResult canRank(com.atlassian.jira.user.ApplicationUser user, Rankable rankable)
      Returns true if the user has the ability to perform a rank operation for a given issue
      Parameters:
      user - : the user in play
      rankable - : the rankable in play
      Returns:
      true if the user can rank this rankable
    • createFlatComparator

      ServiceOutcome<Comparator<Rankable>> createFlatComparator(com.atlassian.jira.user.ApplicationUser user, long customFieldId)
      Create a 'flat' comparator for Rankables. In a flat comparator, subtasks are ranked according to their absolute rank, not to the rank relative to their parent's rank.