com.atlassian.greenhopper.service.backlog
Interface BacklogCustomFieldService

All Known Implementing Classes:
BacklogCustomFieldServiceImpl

public interface BacklogCustomFieldService

Service for operations on the Backlog custom field which links the GH backlog entities to JIRA issues. Custom field operations are notoriously chatty/chained in JIRA, so this abstracts away the complexity and lets us perform interactions between Issue and Backlog without needing knowledge of the custom field structure behind. This service ensures that the custom field exists, so all operations on the custom field should go through here and not try accessing JIRA's CustomFieldManager directly - otherwise we risk situations where there is no custom field, leading to all kinds of errors.

Author:
ahennecke

Field Summary
static java.lang.String SERVICE
           
 
Method Summary
 void connect(com.opensymphony.user.User user, com.atlassian.jira.issue.Issue issue, Backlog backlog)
          Connect the given issue with the given backlog.
 void disconnect(com.opensymphony.user.User user, java.util.Set<com.atlassian.jira.project.Project> projects)
          Disconnects all issues of the passed in projects
 com.atlassian.jira.issue.fields.CustomField getBacklogField()
          Get the CustomField used to associate issues with a backlog.
 Backlog getBacklogFromIssue(com.atlassian.jira.issue.Issue issue)
          Get backlog from issue
 com.atlassian.jira.issue.fields.CustomField getBacklogHistoryField()
          Get the CustomField used to store which backlogs an issue has been associated with Note: The CustomField is automatically created if it doesn't yet exist or has been deleted
 void moveAllIssues(com.opensymphony.user.User user, Backlog source, Backlog target)
          Set the backlog to all issues that are currently associated with source
 void removeFromHistory(com.opensymphony.user.User user, Backlog backlog)
          Remove the history entries for this backlog from all issues that are currently holding it.
 void repair(XProject xproject)
          Repairs the passed in xproject by associating all non-associated issues with the provide unscheduled backlog.
 void repair(XProject xproject, com.atlassian.jira.issue.Issue issue)
          Repairs the passed in issue by associating it with the unscheduled backlog of the given xproject
 void saveToHistory(com.opensymphony.user.User user, com.atlassian.jira.issue.Issue issue, Backlog backlog)
          Save information that the issue has been once in the given backlog.
 

Field Detail

SERVICE

static final java.lang.String SERVICE
See Also:
Constant Field Values
Method Detail

getBacklogField

com.atlassian.jira.issue.fields.CustomField getBacklogField()
Get the CustomField used to associate issues with a backlog. Note: The CustomField is automatically created if it doesn't yet exist or has been deleted


getBacklogFromIssue

Backlog getBacklogFromIssue(com.atlassian.jira.issue.Issue issue)
Get backlog from issue

Returns:
the backlog matching the backlog custom field value on the issue, or null

connect

void connect(com.opensymphony.user.User user,
             com.atlassian.jira.issue.Issue issue,
             Backlog backlog)
Connect the given issue with the given backlog. The custom field value will hold the backlog ID afterwards. No permission checking is done here.


disconnect

void disconnect(com.opensymphony.user.User user,
                java.util.Set<com.atlassian.jira.project.Project> projects)
Disconnects all issues of the passed in projects

Parameters:
projects - a set of projects that are no longer part of an XProject and whose issues therefore need to be disconnected

moveAllIssues

void moveAllIssues(com.opensymphony.user.User user,
                   Backlog source,
                   Backlog target)
Set the backlog to all issues that are currently associated with source


repair

void repair(XProject xproject)
Repairs the passed in xproject by associating all non-associated issues with the provide unscheduled backlog.

Parameters:
xproject - the xproject to repair

repair

void repair(XProject xproject,
            com.atlassian.jira.issue.Issue issue)

Repairs the passed in issue by associating it with the unscheduled backlog of the given xproject

If the issue is already associated to a backlog, nothing will happen.

The operation is done low-level and will not leave a change history entry.


getBacklogHistoryField

com.atlassian.jira.issue.fields.CustomField getBacklogHistoryField()
Get the CustomField used to store which backlogs an issue has been associated with Note: The CustomField is automatically created if it doesn't yet exist or has been deleted


saveToHistory

void saveToHistory(com.opensymphony.user.User user,
                   com.atlassian.jira.issue.Issue issue,
                   Backlog backlog)
Save information that the issue has been once in the given backlog. This is used to calculate statistics like timetracking correctly, since they need to keep that information even if the issue has been moved on to another sprint.

Parameters:
issue - : The issue that's being carried on
backlog - : The backlog that the issue is moved out of

removeFromHistory

void removeFromHistory(com.opensymphony.user.User user,
                       Backlog backlog)
Remove the history entries for this backlog from all issues that are currently holding it. Primarily used to clean up when deleting a backlog.

Parameters:
backlog - : The backlog that gets removed from the history


Copyright © 2007-2011 Atlassian. All Rights Reserved.