public class DefaultIssueToSubTaskConversionService extends DefaultIssueConversionService implements IssueToSubTaskConversionService
IssueToSubTaskConversionService
.fieldLayoutManager, fieldManager, issueTypeSchemeManager, jiraAuthenticationContext
Constructor and Description |
---|
DefaultIssueToSubTaskConversionService(PermissionManager permissionManager,
SubTaskManager subtaskManager,
IssueTypeSchemeManager issueTypeSchemeManager,
JiraAuthenticationContext jiraAuthenticationContext,
WorkflowManager workflowManager,
FieldLayoutManager fieldLayoutManager,
FieldManager fieldManager,
IssueEventManager issueEventManager,
IssueEventBundleFactory issueEventBundleFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertIssue(JiraServiceContext context,
Issue issue)
As per the
IssueToSubTaskConversionService interface. |
protected boolean |
canIssueSecurityFieldIgnore()
For an issue to subtask conversion, we can safely ignore the issue security field since the subtask
will always take the security level of the parent issue.
|
protected static String |
getLongToStringNullSafe(Long aLong)
Returns a String as a result of toString() call or null if aLong was null.
|
protected static boolean |
isNotNullAndNotEqualTo(Long id1,
Long id2)
Returns true if id1 is not null and not equal to id2, false otherwise.
|
void |
preStoreUpdates(JiraServiceContext context,
IssueChangeHolder changeHolder,
Issue currentIssue,
MutableIssue targetIssue)
Allows for a plugin point to extra updates specific to that sub class
|
protected boolean |
projectHasSubTasks(Project project)
Returns true if given project has sub-task Issue Types in its Issue Type scheme
|
void |
validateParentIssue(JiraServiceContext context,
Issue issue,
Issue parentIssue,
String fieldNameParentIssueKey)
Validates the given parent issue key for issue key.
|
void |
validateTargetIssueType(JiraServiceContext context,
Issue issue,
IssueType issueType,
String fieldNameIssueTypeId)
Validates that the issue can be converted to given issue type.
|
convertIssue, getFieldLayoutItems, getFieldLayoutItems, getPermissionNeeded, getRemovedFields, getRemovedFields, getText, getText, getText, hasPermission, isShouldCheckFieldValue, isStatusChangeRequired, isStatusInWorkflowForProjectAndIssueType, populateFields, validateFields, validateTargetStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertIssue, getFieldLayoutItems, getFieldLayoutItems, getRemovedFields, getRemovedFields, hasPermission, isStatusChangeRequired, populateFields, validateFields, validateTargetStatus
public DefaultIssueToSubTaskConversionService(PermissionManager permissionManager, SubTaskManager subtaskManager, IssueTypeSchemeManager issueTypeSchemeManager, JiraAuthenticationContext jiraAuthenticationContext, WorkflowManager workflowManager, FieldLayoutManager fieldLayoutManager, FieldManager fieldManager, IssueEventManager issueEventManager, IssueEventBundleFactory issueEventBundleFactory)
public boolean canConvertIssue(JiraServiceContext context, Issue issue)
IssueToSubTaskConversionService
interface.
NOTE: We also considered a check for number of issues in the project and
returning false if project has only one issue. This was not implemented
as it would impair the performance of this method.canConvertIssue
in interface IssueConversionService
context
- JIRA Service Contextissue
- issue to convertIllegalArgumentException
- if context or issue is nullpublic void validateTargetIssueType(JiraServiceContext context, Issue issue, IssueType issueType, String fieldNameIssueTypeId)
IssueConversionService
validateTargetIssueType
in interface IssueConversionService
context
- jira service contextissue
- issue to convertissueType
- target issue typefieldNameIssueTypeId
- form field name of the issue type idprotected boolean canIssueSecurityFieldIgnore()
canIssueSecurityFieldIgnore
in class DefaultIssueConversionService
public void validateParentIssue(JiraServiceContext context, Issue issue, Issue parentIssue, String fieldNameParentIssueKey)
IssueToSubTaskConversionService
validateParentIssue
in interface IssueToSubTaskConversionService
context
- jira service contextissue
- issue to convertparentIssue
- possible parrent issue to checkfieldNameParentIssueKey
- form field name of the parrent issue keypublic void preStoreUpdates(JiraServiceContext context, IssueChangeHolder changeHolder, Issue currentIssue, MutableIssue targetIssue)
IssueConversionService
preStoreUpdates
in interface IssueConversionService
context
- jira service contextchangeHolder
- holds all the change itemscurrentIssue
- original issue with no updatestargetIssue
- target issue with all fields updatedprotected static boolean isNotNullAndNotEqualTo(Long id1, Long id2)
id1
- id1id2
- id2protected static String getLongToStringNullSafe(Long aLong)
aLong
- longprotected boolean projectHasSubTasks(Project project)
project
- to to testCopyright © 2002-2015 Atlassian. All Rights Reserved.