com.atlassian.jira.imports.project.validation
Class CustomFieldMapperValidatorImpl
java.lang.Object
com.atlassian.jira.imports.project.validation.CustomFieldMapperValidatorImpl
- All Implemented Interfaces:
- CustomFieldMapperValidator
public class CustomFieldMapperValidatorImpl
- extends Object
- implements CustomFieldMapperValidator
- Since:
- v3.13
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomFieldMapperValidatorImpl
public CustomFieldMapperValidatorImpl(CustomFieldManager customFieldManager,
ConstantsManager constantsManager,
ProjectManager projectManager)
validateMappings
public MessageSet validateMappings(I18nHelper i18nHelper,
BackupProject backupProject,
IssueTypeMapper issueTypeMapper,
CustomFieldMapper customFieldMapper)
- Description copied from interface:
CustomFieldMapperValidator
- Validates the automatic mappings that have been created to see if the mappings are relevant in the current
JIRA instances setup.
The following checks are reported as errors and will stop the import:
- A required Custom Field does not exist in the current instance
- The mapped CustomField is of a different Custom Field Type to that in the import file.
- The mapped CustomField is not available for a required Issue Type in this Project.
Note that validation of the actual values in the Custom Fields is done separately by the Custom Field itself.
- Specified by:
validateMappings
in interface CustomFieldMapperValidator
- Parameters:
i18nHelper
- helper bean that allows us to get i18n translationsbackupProject
- is the backup project the data is mapped fromissueTypeMapper
- is the populated issueTypeMappercustomFieldMapper
- is the populated statusMapper
- Returns:
- a MessageSet that will contain any generated errors (which should stop the import) or warnings
(which should be displayed to the user). The error and warning collection's will be empty if all validation
passes.
customFieldIsValidForRequiredContexts
public boolean customFieldIsValidForRequiredContexts(ExternalCustomFieldConfiguration externalCustomFieldConfiguration,
CustomField newCustomField,
String oldCustomFieldId,
CustomFieldMapper customFieldMapper,
IssueTypeMapper issueTypeMapper,
String projectKey)
- Description copied from interface:
CustomFieldMapperValidator
- Returns true if the new custom field is valid for all the issue types that the old custom field is used from.
- Specified by:
customFieldIsValidForRequiredContexts
in interface CustomFieldMapperValidator
- Parameters:
externalCustomFieldConfiguration
- contains the configuration of the custom field as defined in the backup XML.newCustomField
- is a custom field in the current JIRA instance who's context is being checked.oldCustomFieldId
- the old custom field id from the backup XML which will indicate which issue types the
field was used in.customFieldMapper
- is the populated custom field mapper.issueTypeMapper
- is the populated issue type mapper.projectKey
- is the project we are importing into.
- Returns:
- true if the new custom field is valid for all the issue types that the old custom field is used from.
customFieldTypeIsImportable
public boolean customFieldTypeIsImportable(String customFieldTypeKey)
- Description copied from interface:
CustomFieldMapperValidator
- Returns true if the given customFieldTypeKey from the Project Import exists in the current system, and also
implements the CustomFieldImportable interface.
- Specified by:
customFieldTypeIsImportable
in interface CustomFieldMapperValidator
- Parameters:
customFieldTypeKey
- Key of the CustomField Type that we are checking.
- Returns:
- true if the given customFieldTypeKey from the Project Import exists in the current system, and also
implements the CustomFieldImportable interface.
Copyright © 2002-2012 Atlassian. All Rights Reserved.