@Override
public CreateValidationResult validateCreate(final ApplicationUser user, final RemoteIssueLink remoteIssueLink)
{
final ErrorCollection errors = new SimpleErrorCollection();
final I18nHelper i18n = getI18n(user);
validateLinkingEnabled(i18n, errors);
Issue issue = null;
if (!errors.hasAnyErrors())
{
issue = validateIssueExists(remoteIssueLink, errors, i18n);
}
if (!errors.hasAnyErrors())
{
validatePermissionToCreate(user, issue, errors, i18n);
}
if (!errors.hasAnyErrors())
{
validateMandatoryFields(remoteIssueLink, i18n, errors);
validateFieldLengths(remoteIssueLink, i18n, errors);
validateUrls(remoteIssueLink, i18n, errors);
validateGlobalId(remoteIssueLink, issue, errors, i18n);
}
return new CreateValidationResult((errors.hasAnyErrors() ? null : remoteIssueLink), errors);
}