com.atlassian.greenhopper.api.rank
Interface RankService


public interface RankService

Provides a mechanism to rank an issue relative to another one, rank issues absolutely at the top or bottom, compare the positions of two issues and discover rank CustomField objects.

Results of the rank operations are either a RankChange object, or a JIRA ErrorCollection containing the errors encountered.

Since:
v5.8.1
Author:
mtokar

Method Summary
 int compareIssuePosition(long customFieldId, com.atlassian.jira.issue.Issue first, com.atlassian.jira.issue.Issue second)
          Compares two issues against each other.
 java.util.Collection<com.atlassian.jira.issue.fields.CustomField> getRankFields()
          All rank fields which are properly-configured Global Rank custom fields.
 boolean isRankField(long customFieldId)
          Is the passed custom field ID the ID of a properly-configured Global Rank custom field?
 com.atlassian.jira.bc.ServiceOutcome<RankChange> rankAfter(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankAfterIssue)
          Rank an issue after another one.
 com.atlassian.jira.bc.ServiceOutcome<RankChange> rankBefore(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.issue.Issue rankBeforeIssue)
          Rank an issue before another one.
 com.atlassian.jira.bc.ServiceOutcome<RankChange> rankFirst(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue)
          Rank an issue first, thus add it as first global issue.
 com.atlassian.jira.bc.ServiceOutcome<RankChange> rankLast(com.atlassian.crowd.embedded.api.User user, long customFieldId, com.atlassian.jira.issue.Issue issue)
          Rank an issue last, thus add it as last global issue
 

Method Detail

rankBefore

com.atlassian.jira.bc.ServiceOutcome<RankChange> rankBefore(com.atlassian.crowd.embedded.api.User user,
                                                            long customFieldId,
                                                            com.atlassian.jira.issue.Issue issue,
                                                            com.atlassian.jira.issue.Issue rankBeforeIssue)
Rank an issue before another one.

Parameters:
user - The user performing the rank operation
customFieldId - the ID of the custom field
issue - The issue to rank
rankBeforeIssue - The issue to be ranked before.
Returns:
the result of the operation

rankAfter

com.atlassian.jira.bc.ServiceOutcome<RankChange> rankAfter(com.atlassian.crowd.embedded.api.User user,
                                                           long customFieldId,
                                                           com.atlassian.jira.issue.Issue issue,
                                                           com.atlassian.jira.issue.Issue rankAfterIssue)
Rank an issue after another one.

Parameters:
user - The user performing the rank operation
customFieldId - the ID of the custom field
issue - The issue to rank
rankAfterIssue - The issue to be ranked after.
Returns:
the result of the operation

rankFirst

com.atlassian.jira.bc.ServiceOutcome<RankChange> rankFirst(com.atlassian.crowd.embedded.api.User user,
                                                           long customFieldId,
                                                           com.atlassian.jira.issue.Issue issue)
Rank an issue first, thus add it as first global issue.

Parameters:
user - The user performing the rank operation
customFieldId - the ID of the custom field
issue - The issue to rank
Returns:
the result of the operation

rankLast

com.atlassian.jira.bc.ServiceOutcome<RankChange> rankLast(com.atlassian.crowd.embedded.api.User user,
                                                          long customFieldId,
                                                          com.atlassian.jira.issue.Issue issue)
Rank an issue last, thus add it as last global issue

Parameters:
user - The user performing the rank operation
customFieldId - the ID of the custom field
issue - The issue to rank
Returns:
the result of the operation

compareIssuePosition

int compareIssuePosition(long customFieldId,
                         com.atlassian.jira.issue.Issue first,
                         com.atlassian.jira.issue.Issue second)
Compares two issues against each other. Sub-tasks are ranked/compared according to their parent.

Note: if a custom field ID is specified which is not valid for ranking, 0 is returned.

Parameters:
customFieldId - the ID of the rank custom field
first - the first issue
second - the second issue
Returns:
the comparison result - -1, 0 or 1
See Also:
isRankField(long), getRankFields()

isRankField

boolean isRankField(long customFieldId)
Is the passed custom field ID the ID of a properly-configured Global Rank custom field?

Parameters:
customFieldId - the ID of the custom field
Returns:
the result

getRankFields

java.util.Collection<com.atlassian.jira.issue.fields.CustomField> getRankFields()
All rank fields which are properly-configured Global Rank custom fields.

Returns:
the result


Copyright © 2007-2012 Atlassian. All Rights Reserved.