public abstract class DefaultIssueConversionService extends Object implements IssueConversionService
| Modifier and Type | Field and Description |
|---|---|
protected FieldLayoutManager |
fieldLayoutManager |
protected FieldManager |
fieldManager |
protected IssueTypeSchemeManager |
issueTypeSchemeManager |
protected JiraAuthenticationContext |
jiraAuthenticationContext |
| Constructor and Description |
|---|
DefaultIssueConversionService(PermissionManager permissionManager,
WorkflowManager workflowManager,
FieldLayoutManager fieldLayoutManager,
IssueTypeSchemeManager issueTypeSchemeManager,
JiraAuthenticationContext jiraAuthenticationContext,
FieldManager fieldManager,
IssueEventManager issueEventManager,
IssueEventBundleFactory issueEventBundleFactory,
TxnAwareEventFactory txnAwareEventFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract 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.
|
void |
convertIssue(JiraServiceContext context,
Issue currentIssue,
MutableIssue updatedIssue)
This is the core method that converts given issue to an issue represented by updatedIssue.
|
Collection<FieldLayoutItem> |
getFieldLayoutItems(Issue originalIssue,
Issue targetIssue)
Retrieves the collection of
FieldLayoutItem
required to be entered from converting issue from given issue to given target issue. |
protected int |
getPermissionNeeded()
Allows sub-classes override to use another permission
|
Collection<OrderableField> |
getRemovedFields(Issue origIssue,
Issue targetIssue)
Retrieves the fields that have values on the issue but are no longer needed.
|
protected String |
getText(String key)
Translates a given key using i18n bean
|
protected String |
getText(String key,
Object param)
Translates a given key using i18n bean, passing in param
|
protected String |
getText(String key,
String param0,
String param1)
Translates a given key using i18n bean, passing in params
|
boolean |
hasPermission(JiraServiceContext context,
Issue issue)
Checks the user's permission to convert given issue.
|
protected boolean |
isShouldCheckFieldValue(Issue origIssue,
Field field)
JRA-12671 - need to determine if we should call hasValue on the field.
|
boolean |
isStatusChangeRequired(JiraServiceContext context,
Issue issue,
IssueType issueType)
Determines if the workflow status exists in the target workflow (based
on current project and target issue type).
|
protected boolean |
isStatusInWorkflowForProjectAndIssueType(Status status,
Long projectId,
String issueTypeId)
Retrieves the workflow for given project and issue type combination and
checks whether the given status is in this workflow.
|
void |
populateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection<FieldLayoutItem> fieldLayoutItems)
Populates the operationContext from the params in the
ActionContext
In case of invalid values, new error messages are added to the context's error collection under the
fieldName. |
void |
validateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection<FieldLayoutItem> fieldLayoutItems)
Validates that all fields inputed have valid values.
|
void |
validateTargetStatus(JiraServiceContext context,
Status status,
String fieldName,
Issue issue,
IssueType issueType)
Validates that the target status is a valid status for the issue's
project and the target issue type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanConvertIssue, preStoreUpdates, validateTargetIssueTypeprotected final FieldLayoutManager fieldLayoutManager
protected final IssueTypeSchemeManager issueTypeSchemeManager
protected final JiraAuthenticationContext jiraAuthenticationContext
protected final FieldManager fieldManager
public DefaultIssueConversionService(PermissionManager permissionManager, WorkflowManager workflowManager, FieldLayoutManager fieldLayoutManager, IssueTypeSchemeManager issueTypeSchemeManager, JiraAuthenticationContext jiraAuthenticationContext, FieldManager fieldManager, IssueEventManager issueEventManager, IssueEventBundleFactory issueEventBundleFactory, TxnAwareEventFactory txnAwareEventFactory)
public boolean hasPermission(JiraServiceContext context, Issue issue)
IssueConversionServicehasPermission in interface IssueConversionServicecontext - jira service contextissue - issue to check the permission onprotected int getPermissionNeeded()
public boolean isStatusChangeRequired(JiraServiceContext context, Issue issue, IssueType issueType)
IssueConversionServiceisStatusChangeRequired in interface IssueConversionServicecontext - jira service contextissue - issue to convertissueType - target issue typepublic void validateTargetStatus(JiraServiceContext context, Status status, String fieldName, Issue issue, IssueType issueType)
IssueConversionServicevalidateTargetStatus in interface IssueConversionServicecontext - jira service contextstatus - target statusfieldName - form field nameissue - issue to convertissueType - target issue typeprotected boolean isStatusInWorkflowForProjectAndIssueType(Status status, Long projectId, String issueTypeId)
status - issue statusprojectId - project idissueTypeId - issue type idpublic Collection<FieldLayoutItem> getFieldLayoutItems(Issue originalIssue, Issue targetIssue)
IssueConversionServiceFieldLayoutItem
required to be entered from converting issue from given issue to given target issue.getFieldLayoutItems in interface IssueConversionServiceoriginalIssue - Current IssuetargetIssue - Issue with updated issue typeFieldLayoutItem that require values, never nullprotected abstract boolean canIssueSecurityFieldIgnore()
public void populateFields(JiraServiceContext context, OperationContext operationContext, I18nHelper i18nHelper, Issue targetIssue, Collection<FieldLayoutItem> fieldLayoutItems)
IssueConversionServiceActionContext
In case of invalid values, new error messages are added to the context's error collection under the
fieldName.populateFields in interface IssueConversionServicecontext - jira service contextoperationContext - contains Map (CustomFieldValuesHolder) where field values will be populatedi18nHelper - helper bean for i18n (needed by fields)targetIssue - Current issue with updated parent, issue type and statusfieldLayoutItems - Collection of FieldLayoutItem that required inputpublic Collection<OrderableField> getRemovedFields(Issue origIssue, Issue targetIssue)
IssueConversionServicegetRemovedFields in interface IssueConversionServiceorigIssue - issuetargetIssue - issueOrderableField, never nullprotected boolean isShouldCheckFieldValue(Issue origIssue, Field field)
protected to make it testable.
origIssue - The original issue in which we'll check the contextfield - The field in question.public void validateFields(JiraServiceContext context, OperationContext operationContext, I18nHelper i18nHelper, Issue targetIssue, Collection<FieldLayoutItem> fieldLayoutItems)
IssueConversionServicevalidateFields in interface IssueConversionServicecontext - jira service contextoperationContext - contains Map (CustomFieldValuesHolder) containing values to be validatedi18nHelper - helper bean for i18n (needed by fields)targetIssue - Current issue with updated parent, issue type and statusfieldLayoutItems - Collection of FieldLayoutItem that required inputpublic void convertIssue(JiraServiceContext context, Issue currentIssue, MutableIssue updatedIssue)
IssueConversionServiceconvertIssue in interface IssueConversionServicecontext - jira service context, any error are added herecurrentIssue - original issueupdatedIssue - target issueprotected String getText(String key)
key - key to translateprotected String getText(String key, Object param)
key - key to transkateparam - param to insert into propertyprotected String getText(String key, String param0, String param1)
key - key to transkateparam0 - 1st param to insert into propertyparam1 - 2nd param to insert into propertyCopyright © 2002-2022 Atlassian. All Rights Reserved.