In Copado Essentials, depending on the situation, different API versions will be used when retrieving metadata from Salesforce. This article explains how API version is managed within Copado Essentials.
Deploying from org to org
When deploying metadata between Salesforce orgs, Copado Essentials uses the default (latest) API version. The Essentials default API version is periodically updated to match the latest Salesforce release. Check the release notes in Essentials Help for details about the current Essentials default API version.
Commiting metadata from Salesforce org to Git
Before retrieving metadata from a source Salesforce org, Copado Essentials automatically detects the API version of the metadata currently stored in the GIT repository.
If the source is in DX format, Copado Essentials looks at the version number from the sfdx-project.json file in the repository
If the source is in MDAPI classic format, Copado Essentials looks at the version from the package.xml file in the repository
If the repository is empty, the Copado Essentials uses the Essentials default API version.
Once the API version number is determined, Copado Essentials will use this version number to retrieve the metadata from the source Salesforce org. This is to make sure that the new retrieved metadata is in the same version as the current code in your GIT repository.
Deploy metadata from GIT to Salesforce Org
When deploying metadata from Git to a Salesforce org, Copado Essentials respects the API version defined in the package.xml (classic format) or sfdx-project.json (DX-format). If you need to change the API version that Copado Essentials uses, simply update package.xml or sfdx-project.json and commit the changes to your Git repo. Copado Essentials will automatically pick up the updated API version accordingly.
Please note that if you ever update the API version in package.xml or sfdx-project.json, you should also update the content of your metadata files to align with the updated API version.