We would like to pull the email-to-case metadata from scratch, save them in our Version Control System and deploy it through unlocked package (changing/removing EmailServicesAddress attribute in our CI pipelines). How can we retrieve the metadata from scratch?

Thanks for your help.

1 Answer 1


As per the metadata coverage report here you cannot package the CaseSettings as a part of the unlocked package!

You can retrieve and deploy though to various orgs using the metadata API though. To retrieve via the metadata API use the below package.xml as shown below

<?xml version="1.0" encoding="UTF-8"?>
 <Package xmlns="http://soap.sforce.com/2006/04/metadata">

You can retrieve the settings by creating an src folder in your project, have package.xml in the root of the src folder with the above contents and use the below command

sfdx force:mdapi:retrieve -k ./src/package.xml -r ./src --wait=-1 --json

And deploy using the below commands

sfdx force:mdapi:deploy -d ./src --wait=-1 --json

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .