@PublicApi
public interface IssueConversionService
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertIssue(JiraServiceContext context,
Issue issue)
Determines if user can convert given issue.
|
void |
convertIssue(JiraServiceContext context,
Issue issue,
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. |
Collection<OrderableField> |
getRemovedFields(Issue origIssue,
Issue targetIssue)
Retrieves the fields that have values on the issue but are no longer needed.
|
boolean |
hasPermission(JiraServiceContext context,
Issue issue)
Checks the user's permission to convert given issue.
|
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).
|
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 |
preStoreUpdates(JiraServiceContext context,
IssueChangeHolder changeHolder,
Issue currentIssue,
MutableIssue targetIssue)
Allows for a plugin point to extra updates specific to that sub class
|
void |
validateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection<FieldLayoutItem> fieldLayoutItems)
Validates that all fields inputed have valid values.
|
void |
validateTargetIssueType(JiraServiceContext context,
Issue issue,
IssueType issueType,
String fieldNameIssueTypeId)
Validates that the issue can be converted to given issue type.
|
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.
|
boolean canConvertIssue(JiraServiceContext context, Issue issue)
context
- JIRA Service Contextissue
- issue to convertIllegalArgumentException
- if issue is nullboolean hasPermission(JiraServiceContext context, Issue issue)
context
- jira service contextissue
- issue to check the permission onboolean isStatusChangeRequired(JiraServiceContext context, Issue issue, IssueType issueType)
context
- jira service contextissue
- issue to convertissueType
- target issue typeCollection<FieldLayoutItem> getFieldLayoutItems(Issue originalIssue, Issue targetIssue)
FieldLayoutItem
required to be entered from converting issue from given issue to given target issue.originalIssue
- Current IssuetargetIssue
- Issue with updated issue typeFieldLayoutItem
that require values, never nullvoid validateTargetIssueType(JiraServiceContext context, Issue issue, IssueType issueType, String fieldNameIssueTypeId)
context
- jira service contextissue
- issue to convertissueType
- target issue typefieldNameIssueTypeId
- form field name of the issue type idvoid validateTargetStatus(JiraServiceContext context, Status status, String fieldName, Issue issue, IssueType issueType)
context
- jira service contextstatus
- target statusfieldName
- form field nameissue
- issue to convertissueType
- target issue typevoid populateFields(JiraServiceContext context, OperationContext operationContext, I18nHelper i18nHelper, Issue targetIssue, Collection<FieldLayoutItem> fieldLayoutItems)
ActionContext
In case of invalid values, new error messages are added to the context's error collection under the
fieldName.context
- 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 inputCollection<OrderableField> getRemovedFields(Issue origIssue, Issue targetIssue)
origIssue
- issuetargetIssue
- issueOrderableField
, never nullvoid convertIssue(JiraServiceContext context, Issue issue, MutableIssue updatedIssue)
context
- jira service context, any error are added hereissue
- original issueupdatedIssue
- target issuevoid validateFields(JiraServiceContext context, OperationContext operationContext, I18nHelper i18nHelper, Issue targetIssue, Collection<FieldLayoutItem> fieldLayoutItems)
context
- 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 inputvoid preStoreUpdates(JiraServiceContext context, IssueChangeHolder changeHolder, Issue currentIssue, MutableIssue targetIssue)
context
- jira service contextchangeHolder
- holds all the change itemscurrentIssue
- original issue with no updatestargetIssue
- target issue with all fields updatedCopyright © 2002-2019 Atlassian. All Rights Reserved.