Package com.atlassian.jira.config
Class DefaultSubTaskManager
java.lang.Object
com.atlassian.jira.config.DefaultSubTaskManager
- All Implemented Interfaces:
SubTaskManager
-
Field Summary
Fields inherited from interface com.atlassian.jira.config.SubTaskManager
SUB_TASK_ISSUE_TYPE_STYLE, SUB_TASK_LINK_TYPE_INWARD_NAME, SUB_TASK_LINK_TYPE_NAME, SUB_TASK_LINK_TYPE_OUTWARD_NAME, SUB_TASK_LINK_TYPE_STYLE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubTaskManager(ConstantsManager constantsManager, IssueLinkTypeManager issueLinkTypeManager, IssueLinkManager issueLinkManager, PermissionManager permissionManager, ApplicationProperties applicationProperties, IssueTypeSchemeManager issueTypeSchemeManager, IssueManager issueManager, com.atlassian.event.api.EventPublisher eventPublisher, IssueTypeAuditHandler auditHandler) -
Method Summary
Modifier and TypeMethodDescriptionchangeParent(Issue subTask, Issue newParentIssue, ApplicationUser currentUser) Change the parent of the given subtask to the given new parent on behalf of the given user.voidcreateSubTaskIssueLink(Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser) voidvoidTurn on sub-tasks by creating a sub-task issue link type and a default sub-task issue typevoidenableSubTasks(boolean createDefaultIfMissing) Enables sub-tasks on the instance.Retrieves ids of all sub-task issues in the system.getParentIssueId(Issue issue) Returns the parent issue ID of this the given issue.getParentIssueId(Long issueId) Returns the parent issue ID of this the given issue.getParentIssueId(org.ofbiz.core.entity.GenericValue issue) Returns the parent issue ID of this the given issue.getSubTaskBean(Issue issue, ApplicationUser remoteUser) Returns the SubTaskBean for the given parent issue in the context of the given user.getSubTaskIssueLinks(Long issueId) Returns a list of issue links associated with the issueReturns the SubTask IssueType with the given ID.Returns the SubTask IssueType with the given ID.Retrieves all the sub-task issue typesgetSubTaskObjects(Issue parentIssue) Get an issue's subtasks.getVisibleSubTaskObjects(Issue issue, ApplicationUser currentUser) Returns a collection of subtask issues for the given parent issue that are visible to the given user.insertSubTaskIssueType(String name, Long sequence, String description, Long avatarId) Create new issue type and adds it to default scheme.booleanReturn true if the given issue is a subtask.booleanbooleanbooleanissueTypeExistsByName(String name) voidmoveSubTask(Issue parentIssue, Long currentSequence, Long sequence) voidvoidvoidremoveSubTaskIssueType(String name) voidresetSequences(Issue issue) voidUpdate existing sub-task issue type.
-
Constructor Details
-
DefaultSubTaskManager
public DefaultSubTaskManager(ConstantsManager constantsManager, IssueLinkTypeManager issueLinkTypeManager, IssueLinkManager issueLinkManager, PermissionManager permissionManager, ApplicationProperties applicationProperties, IssueTypeSchemeManager issueTypeSchemeManager, IssueManager issueManager, com.atlassian.event.api.EventPublisher eventPublisher, IssueTypeAuditHandler auditHandler)
-
-
Method Details
-
enableSubTasks
Turn on sub-tasks by creating a sub-task issue link type and a default sub-task issue type- Specified by:
enableSubTasksin interfaceSubTaskManager- Throws:
CreateException- if the default sub-task issue type creation failed.
-
enableSubTasks
Description copied from interface:SubTaskManagerEnables sub-tasks on the instance.- Specified by:
enableSubTasksin interfaceSubTaskManager- Parameters:
createDefaultIfMissing- iftrueand there are no sub-task issue types present, then the default sub-task issue type will be created.- Throws:
CreateException- if the default sub-task issue type creation failed.
-
disableSubTasks
public void disableSubTasks()- Specified by:
disableSubTasksin interfaceSubTaskManager
-
getSubTaskIssueTypeObjects
Description copied from interface:SubTaskManagerRetrieves all the sub-task issue types- Specified by:
getSubTaskIssueTypeObjectsin interfaceSubTaskManager- Returns:
- A Collection of all sub-task
IssueTypes.
-
isSubTasksEnabled
public boolean isSubTasksEnabled()- Specified by:
isSubTasksEnabledin interfaceSubTaskManager
-
insertSubTaskIssueType
public IssueType insertSubTaskIssueType(String name, Long sequence, String description, Long avatarId) throws CreateException Description copied from interface:SubTaskManagerCreate new issue type and adds it to default scheme.- Specified by:
insertSubTaskIssueTypein interfaceSubTaskManager- Throws:
CreateException
-
updateSubTaskIssueType
public void updateSubTaskIssueType(String id, String name, Long sequence, String description, Long avatarId) throws DataAccessException Description copied from interface:SubTaskManagerUpdate existing sub-task issue type.- Specified by:
updateSubTaskIssueTypein interfaceSubTaskManager- Throws:
DataAccessException
-
issueTypeExistsByName
- Specified by:
issueTypeExistsByNamein interfaceSubTaskManager
-
moveSubTaskIssueTypeUp
- Specified by:
moveSubTaskIssueTypeUpin interfaceSubTaskManager- Throws:
DataAccessException
-
moveSubTaskIssueTypeDown
- Specified by:
moveSubTaskIssueTypeDownin interfaceSubTaskManager- Throws:
DataAccessException
-
getSubTaskIssueTypeById
Description copied from interface:SubTaskManagerReturns the SubTask IssueType with the given ID.- Specified by:
getSubTaskIssueTypeByIdin interfaceSubTaskManager- Parameters:
id- the ID- Returns:
- SubTask IssueType with the given ID.
-
getSubTaskIssueType
Description copied from interface:SubTaskManagerReturns the SubTask IssueType with the given ID.- Specified by:
getSubTaskIssueTypein interfaceSubTaskManager- Parameters:
id- the ID- Returns:
- SubTask IssueType with the given ID.
-
removeSubTaskIssueType
- Specified by:
removeSubTaskIssueTypein interfaceSubTaskManager- Throws:
RemoveException
-
issueTypeExistsById
- Specified by:
issueTypeExistsByIdin interfaceSubTaskManager
-
isSubTask
Description copied from interface:SubTaskManagerReturn true if the given issue is a subtask.- Specified by:
isSubTaskin interfaceSubTaskManager- Parameters:
issue- the issue- Returns:
- true if the given issue is a subtask.
-
getParentIssueId
Description copied from interface:SubTaskManagerReturns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.- Specified by:
getParentIssueIdin interfaceSubTaskManager- Parameters:
issue- the issue- Returns:
- the parent issue ID of this the given issue, or null.
-
getParentIssueId
Description copied from interface:SubTaskManagerReturns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.- Specified by:
getParentIssueIdin interfaceSubTaskManager- Parameters:
issue- the issue- Returns:
- the parent issue ID of this the given issue, or null.
- See Also:
-
getParentIssueId
Description copied from interface:SubTaskManagerReturns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.- Specified by:
getParentIssueIdin interfaceSubTaskManager- Parameters:
issueId- the issue ID of the subtask- Returns:
- the parent issue ID of this the given issue, or null.
- See Also:
-
getVisibleSubTaskObjects
Description copied from interface:SubTaskManagerReturns a collection of subtask issues for the given parent issue that are visible to the given user. Visibility is determined by checking if the user has BROWSE permission for each subtask.- Specified by:
getVisibleSubTaskObjectsin interfaceSubTaskManager- Parameters:
issue- the parent issue to get the subtasks forcurrentUser- the user to check permissions for- Returns:
- a collection of subtask issues that are visible to the given user
-
getSubTaskBean
Description copied from interface:SubTaskManagerReturns the SubTaskBean for the given parent issue in the context of the given user.- Specified by:
getSubTaskBeanin interfaceSubTaskManager- Parameters:
issue- the IssueremoteUser- the user- Returns:
- the SubTaskBean for the given parent issue in the context of the given user.
-
moveSubTask
- Specified by:
moveSubTaskin interfaceSubTaskManager
-
resetSequences
- Specified by:
resetSequencesin interfaceSubTaskManager
-
getAllSubTaskIssueIds
Retrieves ids of all sub-task issues in the system.- Specified by:
getAllSubTaskIssueIdsin interfaceSubTaskManager
-
getSubTaskIssueLinks
Description copied from interface:SubTaskManagerReturns a list of issue links associated with the issue- Specified by:
getSubTaskIssueLinksin interfaceSubTaskManager- Parameters:
issueId- issue id- Returns:
- a list of issue links
-
getSubTaskObjects
Get an issue's subtasks.- Specified by:
getSubTaskObjectsin interfaceSubTaskManager- Returns:
- A collection of
Issues.
-
createSubTaskIssueLink
public void createSubTaskIssueLink(Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser) throws CreateException - Specified by:
createSubTaskIssueLinkin interfaceSubTaskManager- Throws:
CreateException
-
changeParent
public IssueUpdateBean changeParent(Issue subTask, Issue newParentIssue, ApplicationUser currentUser) throws RemoveException, CreateException Description copied from interface:SubTaskManagerChange the parent of the given subtask to the given new parent on behalf of the given user.- Specified by:
changeParentin interfaceSubTaskManager- Parameters:
subTask- The SubTasknewParentIssue- The parent IssuecurrentUser- The user- Returns:
- an IssueUpdateBean representing the change action.
- Throws:
RemoveException- if there's a problem unlinking original parent.CreateException- if there's a problem linking new parent.
-