Platform Events are a little confusing as the Custom Platform Events found in Salesforce under Platform Events ->Custom Events, are stored under the Custom object metadata type.
Your events will then show as separate Custom Objects in the comparison view.
Depending on how your event is setup you may also need to include a few other metadata types.
The full list of metadata types that relate to Platform Events is as follows.
Custom ObjectPlatform event subscriber configPlatform event channel memberPlatform event channelEvent relay configFlowApex Trigger
Once you have added the above metadata types you should be able to deploy all required changes.
Deploying a Platform event subscriber config across environments
Some values in your metadata are different in each org. A username in a Platform event subscriber config is one example: the same person has a different username in each environment, so one file does not suit every org.
Set the right value per org with environment variables. Gearset replaces the value in the file as it deploys, so the same package works through your pipeline:
Go to
My Account, thenEnvironment variables.Select the target org connection, then click
Add Target.Click
Add environment variable, then select thePlatform event subscriber configmetadata type and the item you deploy.Type the username to find and the username for that org to replace it with, then click
Save.Repeat for each org in your pipeline. To copy a whole set of variables to another org, use
Clone from...orImport CSV.
Gearset applies environment variables to CI job deployments and to validations, so the replacement runs when your pipeline validates the change as well. The metadata item has to be in the deployment package for the replacement to take effect.
ℹ️ License requirements: You need a Deployment Teams or Deployment Enterprise license to use environment variables.
For the full detail, including regex matching and bulk setup, see Using environment variables in Gearset.
