messageSet.addErrorMessageInEnglish("The Issue Link Type '" + issueLinkTypeName + "' has no style value in the backup, but has style '" + newStyle + "' in the current system."); messageSet.addErrorMessageInEnglish("The project to import includes subtasks, but subtasks are disabled in the current system."); messageSet.addErrorMessageInEnglish("The Issue Link Type '" + issueLinkTypeName + "' has style '" + oldStyle + "' in the backup, but has no style in the current system."); messageSet.addErrorMessageInEnglish("The Issue Link Type '" + issueLinkTypeName + "' has style '" + oldStyle + "' in the backup, but has style '" + newStyle + "' in the current system.");
public MessageSet canMapImportValue(final ProjectImportMapper projectImportMapper, final ExternalCustomFieldValue customFieldValue, final FieldConfig fieldConfig, final I18nHelper i18n) { final MessageSet messageSet = new MessageSetImpl(); final String groupname = customFieldValue.getValue(); // ignore empty groupname including null and empty String. if ((groupname != null) && (groupname.length() > 0)) { // Flag the groupname as required - anything missing will be logged under "Groups" projectImportMapper.getGroupMapper().flagValueAsRequired(groupname); // We also do our own tests here to add to out Custom Field context. if (!groupManager.groupExists(groupname)) { // Add an error that the group does not exist messageSet.addErrorMessage(i18n.getText("admin.errors.project.import.group.validation.does.not.exist", groupname)); messageSet.addErrorMessageInEnglish("The group '" + groupname + "' is required for the import but does not exist in the current JIRA instance."); } } return messageSet; }
messageSet.addErrorMessageInEnglish("Issue Linking must be enabled because there are issue links in the project to import."); messageSet.addErrorMessageInEnglish("The Issue Link Type '" + issueLinkTypeName + "' is required for the import but does not exist in the current JIRA instance."); messageSet.addErrorMessageInEnglish("The Issue Link Type '" + issueLinkTypeName + "' is required for the import but has not been mapped."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.issuelinktype.mapped.type.does.not.exist", issueLinkTypeName, newId)); messageSet.addErrorMessageInEnglish("The Issue Link Type '" + issueLinkTypeName + "' was mapped to an IssuelinkType ID (" + newId + ") that does not exist.");
messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.user.validation.missing.users.ext.mgnt.error", String.valueOf(missingMandatoryUserCount)), link); messageSet.addErrorMessageInEnglish("There are '" + missingMandatoryUserCount + "' required user(s) that are missing from the current system. External user management is enabled so the import is unable to create the user(s). You must add the user(s) to the system before the import can proceed."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.user.validation.missing.required.users.error", String.valueOf(unmappedMandatoryUsersNoOldValue)), link); messageSet.addErrorMessageInEnglish("There are '" + unmappedMandatoryUsersNoOldValue + "' required user(s) that JIRA can not automatically create.");
statusDisplayName, issueTypeDisplayName, workflowName); messageSet.addErrorMessage(errorMessage, link); messageSet.addErrorMessageInEnglish("The status '" + statusDisplayName + "' is in use by an issue of type '" + issueTypeDisplayName + "' in the backup file. The default workflow '" + workflowName + "', which is associated with issue type ''{1}'', does not use this status. This workflow is not editable. You must associate a workflow with issue type '" + issueTypeDisplayName + "' that uses the status. To do this you will need to use a workflow scheme."); statusDisplayName, issueTypeDisplayName, workflowName); messageSet.addErrorMessage(errorMessage, link); messageSet.addErrorMessageInEnglish("The status '" + statusDisplayName + "' is in use by an issue of type '" + issueTypeDisplayName + "' in the backup file. The workflow '" + workflowName + "', which is associated with issue type '" + issueTypeDisplayName + "', does not use this status. You must either edit the workflow to use the status or associate a workflow with issue type '" + issueTypeDisplayName + "' that uses the status."); statusDisplayName, issueTypeDisplayName, workflowName, projectKey); messageSet.addErrorMessage(errorMessage, link); messageSet.addErrorMessageInEnglish("The status '" + statusDisplayName + "' is in use by an issue of type '" + issueTypeDisplayName + "' in the backup file. The default workflow '" + workflowName + "', which is associated with issue type '" + issueTypeDisplayName + "', does not use this status. This workflow is not editable. You must create a project with key '" + projectKey + "', instead of letting the import create it for you, and associate a workflow with issue type '" + issueTypeDisplayName + "' that uses the status. To do this you will need to use a workflow scheme.");
/** * Validates the new option that we are mapped to. * * @param i18nHelper I18nHelper * @param customFieldOptionMapper CustomFieldOptionMapper * @param customFieldMapper CustomFieldMapper * @param messageSet MessageSet * @param oldCustomFieldOption ExternalCustomFieldOption * @param newOption Option */ void validateNewOption(final I18nHelper i18nHelper, final CustomFieldOptionMapper customFieldOptionMapper, final CustomFieldMapper customFieldMapper, final MessageSet messageSet, final ExternalCustomFieldOption oldCustomFieldOption, final Option newOption) { // Check that it is for the current Custom Field. final String mappedCustomFieldId = customFieldMapper.getMappedId(oldCustomFieldOption.getCustomFieldId()); final FieldConfig relatedCustomField = newOption.getRelatedCustomField(); final CustomField newCustomField = relatedCustomField.getCustomField(); final Long newCustomFieldId = newCustomField.getIdAsLong(); if (!newCustomFieldId.toString().equals(mappedCustomFieldId)) { final String nameFor = getDisplayNameFor(oldCustomFieldOption, customFieldOptionMapper); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.option.wrong.custom.field", customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()), nameFor)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()) + "' does not contain option '" + nameFor + "', the import can not continue."); } else { // Check that the mapped option agrees with the level validateOptionLevels(i18nHelper, customFieldOptionMapper, messageSet, oldCustomFieldOption, newOption); } }
messageSet.addErrorMessageInEnglish("The parent custom field option '" + oldCustomFieldOption.getValue() + "' from the import file was mapped to a child option ('" + newOption.getValue() + "') in the current JIRA instance."); messageSet.addErrorMessageInEnglish("The child custom field option '" + oldCustomFieldOption.getValue() + "' from the import file was mapped to a parent option ('" + newOption.getValue() + "') in the current JIRA instance."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.option.childs.parent.not.mapped", displayNameFor)); messageSet.addErrorMessageInEnglish("The child custom field option '" + displayNameFor + "' from the import file has a parent option that is not mapped."); messageSet.addErrorMessage(i18nHelper.getText( "admin.errors.project.import.custom.field.option.old.childs.parent.mapping.invalid", nameFor, newOption.getValue())); messageSet.addErrorMessageInEnglish("The child custom field option '" + nameFor + "' from the import file is mapped to option ('" + newOption.getValue() + "') in the current JIRA instance, but their parents aren''t mapped to each other.");
public MessageSet validateMappings(final I18nHelper i18nHelper, final SimpleProjectImportIdMapper simpleProjectImportIdMapper) { final MessageSet messageSet = new MessageSetImpl(); for (final String oldId : simpleProjectImportIdMapper.getRequiredOldIds()) { // Get the mapped id final String newId = simpleProjectImportIdMapper.getMappedId(oldId); if (newId == null) { // Check for orphan data if (simpleProjectImportIdMapper.getKey(oldId) == null) { log.warn("Project Import: The " + getEntityName() + " with ID '" + oldId + "' is orphan data and will be ignored."); } else { // Add an error that the value is not mapped messageSet.addErrorMessage(i18nHelper.getText(getEntityDoesNotExistKey(), simpleProjectImportIdMapper.getDisplayName(oldId))); messageSet.addErrorMessageInEnglish("The " + getEntityName() + " '" + simpleProjectImportIdMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); } } } return messageSet; }
messageSet.addErrorMessageInEnglish("The status with ID '" + oldId + "' is required for the import but could not find this Status configured in the import."); messageSet.addErrorMessageInEnglish("The status '" + statusMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); messageSet.addErrorMessageInEnglish("The status '" + statusMapper.getDisplayName(oldId) + "' is required for the import but was not mapped.");
messageSet.addErrorMessageInEnglish("Sub-tasks are currently disabled in JIRA, please enable sub-tasks. The sub-task issue type '" + issueTypeMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); "admin.errors.project.import.issue.type.validation.subtask.does.not.exist.not.enabled", issueTypeMapper.getDisplayName(oldId))); messageSet.addErrorMessageInEnglish("The issue type '" + issueTypeMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); messageSet.addErrorMessageInEnglish("The issue type '" + issueTypeMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.issue.type.validation.not.in.scheme", issueTypeDisplayName)); messageSet.addErrorMessageInEnglish("The issue type '" + issueTypeDisplayName + "' exists in the system but is not valid for the projects issue type scheme."); errorFoundForThisIssue = true; messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.issue.type.validation.subtask.normal", issueTypeDisplayName)); messageSet.addErrorMessageInEnglish("The issue type '" + issueTypeDisplayName + "' is defined as a sub-task in the backup project, but it is a normal issue type in the current JIRA instance."); errorFoundForThisIssue = true; messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.issue.type.validation.normal.subtask", issueTypeDisplayName)); messageSet.addErrorMessageInEnglish("The issue type '" + issueTypeDisplayName + "' is defined as a normal issue type in the backup project, but it is a sub-task issue type in the current JIRA instance."); errorFoundForThisIssue = true; messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.issue.type.validation.required.not.mapped", issueTypeDisplayName)); messageSet.addErrorMessageInEnglish("The issue type '" + issueTypeDisplayName + "' is required for the import but it is not mapped.");
messageSet.addErrorMessageInEnglish("Unable to import custom field '" + customFieldName + "'. The custom field type does not support project imports."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.wrong.type", customFieldMapper.getDisplayName(oldId), customFieldTypeKey)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldId) + "' in the backup project is of type '" + customFieldTypeKey + "' " + "but the field with the same name in the current JIRA instance is of a different type."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.wrong.context", customFieldMapper.getDisplayName(oldId), issueTypeNames)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldId) + "' in the backup project is used by issue types '" + issueTypeNames + "' but the field with the same name in the current JIRA instance is not available to those issue types in this project.");
"admin.errors.project.import.issue.security.level.validation.does.not.exist.project.exists", issueSecurityLevelMapper.getDisplayName(oldId))); messageSet.addErrorMessageInEnglish("The Issue Security Level '" + issueSecurityLevelMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); "admin.errors.project.import.issue.security.level.validation.does.not.exist.project.doesnt.exist", issueSecurityLevelMapper.getDisplayName(oldId), backupProject.getProject().getKey())); messageSet.addErrorMessageInEnglish("The Issue Security Level '" + issueSecurityLevelMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance.");
public MessageSet validateMappings(final I18nHelper i18nHelper, final SimpleProjectImportIdMapper simpleProjectImportIdMapper) { final MessageSet messageSet = new MessageSetImpl(); for (final String oldId : simpleProjectImportIdMapper.getRequiredOldIds()) { // Get the mapped id final String newId = simpleProjectImportIdMapper.getMappedId(oldId); if (newId == null) { // Check for orphan data if (simpleProjectImportIdMapper.getKey(oldId) == null) { messageSet.addWarningMessage(i18nHelper.getText("admin.errors.project.import.project.role.validation.orphan", oldId)); messageSet.addWarningMessageInEnglish("The project role with id '" + oldId + "' can not be resolved into an actual project role in the backup file. Any comments or worklogs that were protected by this project role will no longer have a visibility restriction."); } else { // Add an error that the value is not mapped messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.project.role.validation.does.not.exist", simpleProjectImportIdMapper.getDisplayName(oldId))); messageSet.addErrorMessageInEnglish("The Project Role '" + simpleProjectImportIdMapper.getDisplayName(oldId) + "' is required for the import but does not exist in the current JIRA instance."); } } } return messageSet; }
messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.option.does.not.exist", customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()), nameFor)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()) + "' requires option '" + nameFor + "' for the import but it does not exist in the current JIRA instance."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.option.child.does.not.exist", customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()), parentName, childOptionValue)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()) + "' requires option with parent '" + parentName + "' and value '" + childOptionValue + "' for the import but it does not exist in the current JIRA instance."); customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()), displayNameFor)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldCustomFieldOption.getCustomFieldId()) + "' requires option '" + displayNameFor + "' for the import but it does not exist in the current JIRA instance.");
messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldId) + "' of type '" + getCustomFieldTypeName(oldCustomFieldConfig) + "' is required for the import but does not exist in the current JIRA instance."); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldId) + "' in the backup project is of type '" + getCustomFieldTypeName(oldCustomFieldConfig) + "' but the field with the same name in the current JIRA instance is of a different type."); messageSet.addErrorMessage(i18nHelper.getText("admin.errors.project.import.custom.field.wrong.context", customFieldMapper.getDisplayName(oldId), issueTypeNames)); messageSet.addErrorMessageInEnglish("The custom field '" + customFieldMapper.getDisplayName(oldId) + "' in the backup project is used by issue types '" + issueTypeNames + "' but the field with the same name in the current JIRA instance is not available to those issue types in this project.");