From the left-hand menu in Gearset, select
Configure and deploy under
Data Deployments and select the source and target org from your list of linked orgs.
In this example, the case is in my Production org and I want to deploy it to my UAT org for testing.
Attachments from the emails can also be deployed with the email if required.
Once in the
Configure data deployment menu, first select
Case in the menu on the left-hand side and if required, add a field to the filter, to select the cases you want to deploy.
Next, to deploy the linked emails,
EmailMessage needs to be selected. Tick the checkbox filter by parent object and change it to
Case.Emails. In the reference fields to deploy, make sure
RelatedToId is checked.
If email attachments are also needed, select
ContentDocumentLink from the left-hand menu and again filter by parent object using
Once all the objects have been selected click next.
Here we need to make sure the
EmailMessage has its deployment method set to
Create new records. We also must include the
ContentVersion as related objects if deploying attachments. All the other related objects are optional. Select Next to proceed.
Once the deployment has completed, we can check to see if the case has been deployed successfully.
Going into the email we can see that the attachments have also been deployed.