Improve "check for errors" to avoid migration errors due to leading/trailing spaces

XMLWordPrintable

      Issue Summary

      JRASERVER-71438 describes a problem with leading/trailing spaces in objects' names during an import.

      This also can be a problem during a Server -> Cloud migration if you have objects (say an issue type) with a space in its name.

      Steps to Reproduce

      1. Create an issue type called 'Maintenance' in the Cloud
      2. Create an issue type called 'Maintenance ' in the Server (notice a trailing blank space)
      3. Migrate Jira Server projects to the Cloud via JCMA

      Expected Results

      Objects migrated.

      Actual Results

      An error is thrown indicating a duplicate issue type.

      The below exception is thrown in the Error log section under the Logs and reports UI, that's shown after the migration finishes:

      2021-04-26 18:01:30.735 ERROR CRYP project-import We couldn't import Issue Type 'Maintenance '. Reason: IllegalArgumentException: Validation error: {IssueType=An issue type with this name already exists.}.
      

      Notice the trailing space in the issue type name in the snippet above.

      This error indicates that there's a duplicate Issue Type, whereas it shouldn't.
      If you remove the trailing space in the Server issue type's name, this error won't surface anymore.

       Workaround

      The current manual workaround is to manually remove the trailing space in the Server before attempting the migration.

      The suggestion here is that a check is implemented in the pre-migration validations. Example:

      • add a logic that removes the trailing space of the issue type so that it can figure out that 'Maintenance ' and 'Maintenance' are the same issue type

      or

      • add a step to the pre-migration check that fails if an issue type has a trailing space in its name and directs the user to correct it before starting the migration

            Assignee:
            Unassigned
            Reporter:
            Osimar M. (Osi) | Atlassian Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: