Public Group - retrieve and deploy

Guidance on how to retrieve and deploy Public Group using Group metadata type

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over a week ago

What metadata type to select in the filter?

Public Groups are stored in the Group metadata type.
โ€‹
So in order to deploy a Public Group, you'd need to include Group metadata type in your metadata filter, which should look like like this:

You can also use Gearset's Default comparison metadata filter, which already includes the Group metadata type.

How does Public Group look in the comparison results?

Below is an example of a Public Group found in the comparison results when Group metadata type is selected.

Preview in the Compare 2.0

The user interface of the comparison results may differ slightly if you're using Compare 2.0 to retrieve a public group, in which case the interface would look as below:

Where to find this change in the Salesforce org?

For extra context, in this Salesforce org the group's location is in Users > Public Groups.

Is it possible to retrieve users assigned to a Public Group?

Some Gearset users have asked how to retrieve users assigned to a Public Group in their org.

For example, in this org an assigned use looks like this:

If this is the type of change you're looking to deploy between environments, we found out that Group metadata type won't retrieve users assigned to a specific Public Group.

It's because users are treated as data, not metadata. Therefore, metadata API won't support its retrieval.
โ€‹
So you'd need to consider adding it manually in your target org as a post-deployment step.

Did this answer your question?