New custom field IDs are different after deploying a snapshot
Symptoms:
The identifiers of some custom fields are different when they are created with a snapshot deployment. E.g. on the source JIRA there is a custom field "Test" with ID customfield_10460, after deploying a snapshot with this field it gets created on the target with ID customfield_10600.
Cause:
The custom field ID's are based on their DB ID's and are automatically assigned by the underlying framework. So, there is no way for an add-on to guarantee the native ID's of a field (or any configuration object) when creating it. This is true even if the systems have started as identical.
Resolution:
If you use the custom fields in scripts it's a good idea to use the field names as identifiers as they can be used in an instance independent manner.
If that's not an option, you can select the "Persist deployed snapshot to current system native ID mappings" in CMJ's general settings before deploying. Then, when you deploy a snapshot, CMJ will produce a JSON file with mappings of the native IDs of all objects from the snapshot to their matches on the target JIRA. You can use this mapping file to update the corresponding field ID's in any scripts, etc.