The Jira Cloud Migration Assistant fails to complete due to the error "We couldn't export Automation Rules"

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The Jira Cloud Migration Assistant fails to complete its execution due to the error below:

1 2023-06-13 10:58:55.152903 ERROR XX project-export We couldn't export Automation Rules 446. Reason: java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.String (java.lang.Long and java.lang.String are in module java.base of loader 'bootstrap'). [JCMA 000]

Environment

  • Jira Service Management (JSM) Server / Data Center on any version

  • Jira Cloud Migration Assistant on any version

Cause

The error is related to the Legacy automation feature coming from Jira Service Management (JSM), and not from Automation For Jira. The error is thrown in the logs because at least one of the Legacy Automation rule is invalid (it might contain an invalid trigger, condition, or action).

Solution

To get rid of this error, we need to first identify the automation rule(s) correspond to the rule ID(s) mentioned in the error and either delete the rule, or fix the error.

Here are the steps to follow:

  • Run the SQL query below in the Jira Database, after replacing <XXXXX> with the ID found in the error (446 in the error mentioned above):

    1 2 3 4 5 6 SELECT * FROM "AO_9B2E3B_RULE" LEFT JOIN "AO_9B2E3B_RSETREV_PROJ_CONTEXT" ON "AO_9B2E3B_RULE"."RULESET_REVISION_ID" = "AO_9B2E3B_RSETREV_PROJ_CONTEXT"."RULESET_REVISION_ID" LEFT JOIN "AO_9B2E3B_RULESET" ON "AO_9B2E3B_RULESET"."ACTIVE_REVISION_ID" = "AO_9B2E3B_RULE"."RULESET_REVISION_ID" LEFT JOIN "AO_9B2E3B_RULESET_REVISION" ON "AO_9B2E3B_RULESET_REVISION"."RULE_SET_ID" = "AO_9B2E3B_RULESET"."ID" WHERE "AO_9B2E3B_RULESET_REVISION"."RULE_SET_ID" = <XXXXX>;
  • Check the result from the SQL query and get the following information:

    • Project Name the rule belongs to:

      • Get the project ID the rule belongs to, by checking the column PROJECT_ID.

      • From this ID, get the name of the project by looking for this ID in the project table in the Jira Database

    • Rule name

      • Get the name of the automation rule by checking the column NAME.

  • Navigate to the administration page of the JSM project identified in the previous step, and then go to the Legacy Automation page:

    • For Jira versions under 9.0.0 (or JSM versions under 5.0.0), it is located under Project Settings > Automation

    • For Jira versions under 9.0.0 (or JSM versions under 5.0.0), it is located under Project Settings > Legacy Automation

  • If you get the error Snap! You can't view this page while trying to navigate to the automation menu, please refer to the KB article below to fix that error:

  • Look for the name of the automation identified in the SQL query. You should see some warning underneath it:

    (Auto-migrated image: description temporarily unavailable)
  • Click on the Edit button next to this automation rule, and look for the module that has the error (WHEN, IF, or THEN). You have 2 options:

    • Either fix the broken module, by changing it to a valid one

    • Or delete the whole automation rule if you no longer need it, as illustrated below:

      (Auto-migrated image: description temporarily unavailable)
  • After the automation rule is fixed (or deleted), run the Migration Assistant again. The error should no longer happen.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.