@PublicApi public interface

SubTaskManager

com.atlassian.jira.config.SubTaskManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Manages SubTasks - issues that are "part of" other issues.

Summary

Constants
String SUB_TASK_ISSUE_TYPE_STYLE
String SUB_TASK_LINK_TYPE_INWARD_NAME
String SUB_TASK_LINK_TYPE_NAME
String SUB_TASK_LINK_TYPE_OUTWARD_NAME
String SUB_TASK_LINK_TYPE_STYLE
Public Methods
IssueUpdateBean changeParent(Issue subTask, Issue parentIssue, ApplicationUser currentUser)
Change the parent of the given subtask to the given new parent on behalf of the given user.
void createSubTaskIssueLink(Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser)
void disableSubTasks()
void enableSubTasks()
Enables sub-tasks on the instance.
void enableSubTasks(boolean createDefaultIfMissing)
Enables sub-tasks on the instance.
Collection<Long> getAllSubTaskIssueIds()
@Nullable Long getParentIssueId(GenericValue issue)
This method is deprecated. Use getParentIssueId(Issue) instead. Since v6.4.
@Nullable Long getParentIssueId(Issue issue)
Returns the parent issue ID of this the given issue.
@Nullable Long getParentIssueId(Long issueId)
Returns the parent issue ID of this the given issue.
SubTaskBean getSubTaskBean(Issue issue, ApplicationUser remoteUser)
Returns the SubTaskBean for the given parent issue in the context of the given user.
List<IssueLink> getSubTaskIssueLinks(Long issueId)
Returns a list of issue links associated with the issue
IssueType getSubTaskIssueType(String id)
Returns the SubTask IssueType with the given ID.
IssueType getSubTaskIssueTypeById(String id)
This method is deprecated. Use getSubTaskIssueType(String) instead. Since v5.0.
Collection<IssueType> getSubTaskIssueTypeObjects()
Retrieves all the sub-task issue types
Collection<Issue> getSubTaskObjects(Issue issue)
IssueType insertSubTaskIssueType(String name, Long sequence, String description, Long avatarId)
Create new issue type and adds it to default scheme.
@Deprecated IssueType insertSubTaskIssueType(String name, Long sequence, String description, String iconurl)
This method is deprecated. Use insertSubTaskIssueType(String, Long, String, Long) since v6.3.
boolean isSubTask(Issue issue)
Return true if the given issue is a subtask.
boolean isSubTasksEnabled()
boolean issueTypeExistsById(String id)
boolean issueTypeExistsByName(String name)
void moveSubTask(Issue issue, Long currentSequence, Long sequence)
void moveSubTaskIssueTypeDown(String id)
void moveSubTaskIssueTypeUp(String id)
void removeSubTaskIssueType(String name)
void resetSequences(Issue issue)
@Deprecated void updateSubTaskIssueType(String id, String name, Long sequence, String description, String iconurl)
This method is deprecated. Use updateSubTaskIssueType(String, String, Long, String, Long) instead. Since v6.3.
void updateSubTaskIssueType(String id, String name, Long sequence, String description, Long avatarId)
Update existing sub-task issue type.

Constants

public static final String SUB_TASK_ISSUE_TYPE_STYLE

Constant Value: "jira_subtask"

public static final String SUB_TASK_LINK_TYPE_INWARD_NAME

Constant Value: "jira_subtask_inward"

public static final String SUB_TASK_LINK_TYPE_NAME

Constant Value: "jira_subtask_link"

public static final String SUB_TASK_LINK_TYPE_OUTWARD_NAME

Constant Value: "jira_subtask_outward"

public static final String SUB_TASK_LINK_TYPE_STYLE

Constant Value: "jira_subtask"

Public Methods

public IssueUpdateBean changeParent (Issue subTask, Issue parentIssue, ApplicationUser currentUser)

Change the parent of the given subtask to the given new parent on behalf of the given user.

Parameters
subTask The SubTask
parentIssue The parent Issue
currentUser 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.

public void createSubTaskIssueLink (Issue parentIssue, Issue subTaskIssue, ApplicationUser remoteUser)

public void disableSubTasks ()

public void enableSubTasks ()

Enables sub-tasks on the instance. If 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.

public void enableSubTasks (boolean createDefaultIfMissing)

Enables sub-tasks on the instance.

Parameters
createDefaultIfMissing if true and 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.

public Collection<Long> getAllSubTaskIssueIds ()

@Nullable public Long getParentIssueId (GenericValue issue)

This method is deprecated.
Use getParentIssueId(Issue) instead. Since v6.4.

Returns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.

Parameters
issue the issue
Returns
  • the parent issue ID of this the given issue, or null.

@Nullable public Long getParentIssueId (Issue issue)

Returns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.

Parameters
issue the issue
Returns
  • the parent issue ID of this the given issue, or null.

@Nullable public Long getParentIssueId (Long issueId)

Returns the parent issue ID of this the given issue. Will return null if the given issue is not a subtask.

Parameters
issueId the issue ID of the subtask
Returns
  • the parent issue ID of this the given issue, or null.

public SubTaskBean getSubTaskBean (Issue issue, ApplicationUser remoteUser)

Returns the SubTaskBean for the given parent issue in the context of the given user.

Parameters
issue the Issue
remoteUser the user
Returns
  • the SubTaskBean for the given parent issue in the context of the given user.

public List<IssueLink> getSubTaskIssueLinks (Long issueId)

Returns a list of issue links associated with the issue

Parameters
issueId issue id
Returns
  • a list of issue links

public IssueType getSubTaskIssueType (String id)

Returns the SubTask IssueType with the given ID.

Parameters
id the ID
Returns
  • SubTask IssueType with the given ID.

public IssueType getSubTaskIssueTypeById (String id)

This method is deprecated.
Use getSubTaskIssueType(String) instead. Since v5.0.

Returns the SubTask IssueType with the given ID.

Parameters
id the ID
Returns
  • SubTask IssueType with the given ID.

public Collection<IssueType> getSubTaskIssueTypeObjects ()

Retrieves all the sub-task issue types

Returns

public Collection<Issue> getSubTaskObjects (Issue issue)

public IssueType insertSubTaskIssueType (String name, Long sequence, String description, Long avatarId)

Create new issue type and adds it to default scheme.

@Deprecated public IssueType insertSubTaskIssueType (String name, Long sequence, String description, String iconurl)

This method is deprecated.
Use insertSubTaskIssueType(String, Long, String, Long) since v6.3.

Create new issue type and adds it to default scheme.

public boolean isSubTask (Issue issue)

Return true if the given issue is a subtask.

Parameters
issue the issue
Returns
  • true if the given issue is a subtask.

public boolean isSubTasksEnabled ()

public boolean issueTypeExistsById (String id)

public boolean issueTypeExistsByName (String name)

public void moveSubTask (Issue issue, Long currentSequence, Long sequence)

public void moveSubTaskIssueTypeDown (String id)

public void moveSubTaskIssueTypeUp (String id)

public void removeSubTaskIssueType (String name)

public void resetSequences (Issue issue)

@Deprecated public void updateSubTaskIssueType (String id, String name, Long sequence, String description, String iconurl)

This method is deprecated.
Use updateSubTaskIssueType(String, String, Long, String, Long) instead. Since v6.3.

public void updateSubTaskIssueType (String id, String name, Long sequence, String description, Long avatarId)

Update existing sub-task issue type.