com.atlassian.jira.issue.managers
Class DefaultIssueManager

java.lang.Object
  extended bycom.atlassian.jira.issue.managers.DefaultIssueManager
All Implemented Interfaces:
IssueManager, JiraManager

public class DefaultIssueManager
extends java.lang.Object
implements IssueManager


Constructor Summary
DefaultIssueManager(WorkflowManager workflowManager, AssociationManager associationManager, TextAnalyzer textAnalyzer)
           
 
Method Summary
 GenericValue createIssue(User remoteUser, java.util.Map fields)
          This function creates an issue in Jira.
 java.util.Collection execute(SearchRequest searchRequest, User searcher)
          Takes a search request object and returns a list of issues that match the search request
 java.util.List getEntitiesByIssue(java.lang.String relationName, GenericValue issue)
          Get a list of entities related to this issue by their relationship name.
 GenericValue getIssue(java.lang.Long id)
           
 GenericValue getIssue(java.lang.String key)
           
 GenericValue getIssueByWorkflow(java.lang.Long wfid)
           
 java.util.List getIssuesByEntity(java.lang.String relationName, GenericValue entity)
          Get a list of issues related to this entity by their relationship name.
 java.util.List getIssueWatchers(GenericValue issue)
          Return a list of users that are watching an issue.
 java.util.List getVotedIssues(User user)
          Retrieves all the issues a user has voted for.
 java.util.List getWatchedIssues(User user)
           
 void notifyTrackbacks(GenericValue issue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.IssueManager
createIssue
 

Constructor Detail

DefaultIssueManager

public DefaultIssueManager(WorkflowManager workflowManager,
                           AssociationManager associationManager,
                           TextAnalyzer textAnalyzer)
Method Detail

getIssue

public GenericValue getIssue(java.lang.Long id)
                      throws GenericEntityException
Specified by:
getIssue in interface IssueManager
Throws:
GenericEntityException

getIssue

public GenericValue getIssue(java.lang.String key)
                      throws GenericEntityException
Specified by:
getIssue in interface IssueManager
Throws:
GenericEntityException

getIssueByWorkflow

public GenericValue getIssueByWorkflow(java.lang.Long wfid)
                                throws GenericEntityException
Specified by:
getIssueByWorkflow in interface IssueManager
Throws:
GenericEntityException

getEntitiesByIssue

public java.util.List getEntitiesByIssue(java.lang.String relationName,
                                         GenericValue issue)
                                  throws GenericEntityException
Description copied from interface: IssueManager
Get a list of entities related to this issue by their relationship name. Example relation names include IssueRelationConstants.VERSION, IssueRelationConstants.COMPONENT - IssueRelationConstants

Specified by:
getEntitiesByIssue in interface IssueManager
Throws:
GenericEntityException

getIssuesByEntity

public java.util.List getIssuesByEntity(java.lang.String relationName,
                                        GenericValue entity)
                                 throws GenericEntityException
Description copied from interface: IssueManager
Get a list of issues related to this entity by their relationship name. Example relation names include IssueRelationConstants.VERSION, IssueRelationConstants.COMPONENT - IssueRelationConstants

Specified by:
getIssuesByEntity in interface IssueManager
Throws:
GenericEntityException

createIssue

public GenericValue createIssue(User remoteUser,
                                java.util.Map fields)
                         throws CreateException
This function creates an issue in Jira. Read the javadoc under the fields parameter to see what object need to be passed to create an issue.

Parameters:
remoteUser - User that is creating this issue
fields - see below

Required Fields

projectId: A Long value representing the id of the project
issueType: The String id of an issueType
summary: A String describing the issue (max 255 chars)

Recomended Fields

assignee: A String representing the username of the assignee
reporter: A String representing the username of the reporter
priority: The String id of a priority

Optional Fields

description: A String description of the issue
environment: A String description of the environment the issue is in. e.g W2K
fixVersions: A List of Long values representing fixVersion ids
components: A List of Long values representing component ids
timeOriginalEstimate: A Long value representing the number of seconds this tast should take
timeEstimate: A Long value representing the number of seconds allocated for this issue
versions: = A List of Long value representing version ids
customFields: A Map containing a Long Key which is the custom field id and a String Value which is the value for the custom field
created: The date which the issue was created. If not specified, defaults to System.currentTimeMillis()
updated: The date which the issue was updated. If not specified, defaults to System.currentTimeMillis()
Returns:
A generic value representing the issue created
Throws:
CreateException
See Also:
IssueCreateFunction

notifyTrackbacks

public void notifyTrackbacks(GenericValue issue)

getVotedIssues

public java.util.List getVotedIssues(User user)
                              throws GenericEntityException,
                                     EntityNotFoundException
Retrieves all the issues a user has voted for.

Specified by:
getVotedIssues in interface IssueManager
Parameters:
user - The user that has voted
Returns:
List of Issues the user has voted on
Throws:
GenericEntityException
EntityNotFoundException

getIssueWatchers

public java.util.List getIssueWatchers(GenericValue issue)
                                throws GenericEntityException,
                                       EntityNotFoundException
Return a list of users that are watching an issue.

Specified by:
getIssueWatchers in interface IssueManager
Parameters:
issue - The issue
Returns:
List of Users
Throws:
GenericEntityException
EntityNotFoundException

getWatchedIssues

public java.util.List getWatchedIssues(User user)
                                throws GenericEntityException,
                                       EntityNotFoundException
Specified by:
getWatchedIssues in interface IssueManager
Throws:
GenericEntityException
EntityNotFoundException

execute

public java.util.Collection execute(SearchRequest searchRequest,
                                    User searcher)
                             throws SearchException
Takes a search request object and returns a list of issues that match the search request

Specified by:
execute in interface IssueManager
Parameters:
searchRequest - object to be used to search for
Returns:
A List of Issues that match the search request
Throws:
SearchException