This guide aims to assist your team in effectively preparing Find and Replace rule when you run a deployment in Copado Essentials.
Start by downloading the metadata package from the Source Org.
If the deployment has a Find And Replace rule, Essentials will find any metadata files in the deployment package what matches the "file_filters" in the rule. Then apply the "replace_rules" to this files.
Finally, deploy the updated package to the Target Org.
Below are the steps to prepare for a Find And Replace Rule:
First go to the deployment, click on More > Retrieve Package for Download, then download the deployment package.
After that, look at the package to see which metadata file you want to apply the rule. For example in a deployment below there is a flow named "Variables". In the deployment package, the metadata file name is "Variables.flow".
If you want to replace all the dev email to prod email in this flow, we can prepare a rule below:
---
rule_replace_outbound_user_email:
file_filters:
- 'Variables.workflow'
replace_rules:
- find: 'dev@mycompany.com'
replace: 'prod@mycompany.com'
Then go to the "Deploy Option" tab and save the rule. Then download the deployment package again and check if the rule is applied correctly to the metadata file.
Notes:
You can find some sample rules in our document: https://docs.essentials.copado.com/en/articles/4109755-find-and-replace-environmental-variables
The rule is in YAML format, you can some online tools (eg. https://www.yamllint.com/) to validate the rule before saving it to the deployment.
Hope this help your team to prepare the rule.