While migrating Jira Service Management project, some SLAs (time metric) fail to export because of dependence on invalid issue statuses.
- Go to Jira Administration -> Issues -> Statuses. Create a new Issue Status, say "Dismissed".
- Select any workflow that is used in the project. Edit it such that it now includes the newly created status "Dismissed"
- Go to Project Settings -> SLAs. Create a new SLA such that one of the Start/Stop/Pause conditions have the "Dismissed" status selected. Save the SLA.
- Edit the workflow (the one modified in step 2) such that it does not contain the "Dismissed" status anymore.
- Go to Jira Administration -> Issues -> Statuses. Delete the status "Dismissed"
- Migrate the project.
The project should be migrated successfully. The migrated SLA does not refer to the deleted status.
The below exception is thrown in the export error logs file:
The following SQL query (written for PostgreSQL) should ideally return an empty response. If the query returns one or more IDs, each ID represents a reference to an invalid status.
(The query returns the IDs of those statuses that are referred to in SLAs but are not found in the status table (do not exist - likely because they were deleted)).
NOTE: It is recommended to create a backup your server before executing the workarounds.
- Open project settings for the particular project.
- Go to SLAs.
- Select each SLA one-by-one. If the SLA contains invalid status reference, an error message should be displayed similar to attached image 1.png
- Edit the SLA. Remove the problematic statuses from the conditions and save the SLA. (2.png)
- Once all SLAs are fixed, click the update link below the SLA menu (shown in image 3.png).
- Attempt to migrate the project again.
- Remove the references to invalid statuses using the following query. Note: This query will also remove similar invalid status references in SLAs across all project.
2. Attempt to migrate the project again.