Project-import error "We couldn't import Time Metric" due to Bad Request

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Check what to do when your Jira Cloud Migration Assistant (JCMA) project migration is failing with "We couldn't import Time Metric XXX. Reason: 400 Bad Request".

Overview

When trying to run the Jira Cloud Migration Assistant (JCMA) to migrate data from Server to the Atlassian Cloud, the migration plan fails with the following message related to an SLA/Time Metric dependency:

ERROR PKEY project-import We couldn't import Time Metric XXX. 
Reason: 400 Bad Request: "{"indexToRestErrorResponse":{"0": {"errors":\[],"reasonKey":"sd.sla.metric.custom.field.id.used","reasonCode":"400"}

This happens because some Jira Issues may use a project value (id or key) from another project. These values may be referenced in a custom field of type Project Picker.

If the dependent project is not included in the migration plan, then JCMA can't bring its references.

Identify

Run this query on the Jira server database to identify which Jira Issues from the project key referenced on the logs are affected by this problem.

Replace the XXX placeholder with the id of the SLA/time metric listed in the error message.

SELECT * FROM "AO_54307E_TIMEMETRIC" WHERE "ID" = XXX;

Solution

Remove SLA

If the SLA is not required, the data does not need to be migrated.

In this case, the SLA association should be removed from the project.

  1. Open the Jira Service Management project as a project administrator.
  2. Click Project settings.
  3. Click SLAs.
  4. Select the applicable SLA as identified from the database query. This should also match the URL - /servicedesk/admin/<PKEY>/sla/custom/<sla_id>
  5. Click Delete SLA.
  6. Click Confirm.

If necessary, you may remove the SLA from the database following Removing Orphaned SLAs from the database.

Note that this affects all projects, and the SLA is removed entirely, which should be viewed as a last resort.

Reconfigure SLA

If data is necessary to be migrated, we recommend reconfiguring the SLA.

  1. Open the Jira Service Management project as a project administrator.
  2. Click Project settings.
  3. Click SLAs.
  4. Create a new, similarly named SLA based on the existing configurations.
  5. Migrate the project to Jira Cloud.
  6. Once the project has been successfully migrated, and all projects leveraging the SLA have been migrated/the migration has been completed, consider renaming the field and reconfiguring dashboards, queues, reports, filters, and so on.
Last modified on Apr 22, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.