This article explains how to fix the Integrity Check violation for reference to missing custom fields from the Database.
Problem
Deployment fails with an error “Unable to perform deployment: Unable to apply change 'type: removal, object: JiraCustomField#DMP 11. What metadata standard will be used?_com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons, target object: JiraConfigurationRoot#root, feature: customFields'“
Example code error
java.util.concurrent.ExecutionException: com.botronsoft.jira.rollout.snapshot.SnapshotOperationFailedException: Unable to perform deployment: Unable to apply change 'type: removal, object: JiraCustomField
This issue happens when restoring a configuration at the time of deployment from the source Jira to the target Jira, including the deletion of some custom fields that are still in the target environment but shouldn't be (as they have been deleted in production).
When doing the restore configuration action, Configuration Manager is unable to finish the deployment because errors occur when a custom field is deleted.
Instructions
Solution
Perform a cache refresh from CMJ's advanced page.
Execute the following DB query when replacing %MISSING_CUSTOM_FIELD_ID with the missing CustomFied ID from the Integrity check for Jira
SELECT * FROM AO_54307E_VIEWPORTFIELD as field inner join AO_54307E_VIEWPORTFORM as form ON field.form_id = form.id where field_id = '%MISSING_CUSTOM_FIELD_ID'
With the above-mentioned DB query, you can have a better view of the request types that have reference to the missing custom fields if there are any.
After that, these references must be deleted from the AO_54307E_VIEWPORTFIELD table using their table id.
Perform a Database backup before performing an UPDATE or DELETE query.
Running the below query, by replacing the placeholder with the database id of the custom field, will delete the reference.
DELETE FROM AO_54307E_VIEWPORTFIELD where ID =%
After the Database manipulation cache refresh from CMJ's advanced page must be triggered.
After that, run an integrity check for Jira again.
As a general precaution, before any direct database update, it is recommended to take a database backup. After the update, run a cache refresh for the changes to take effect (this can be done from CMJ's Advanced page)