Skip to main content

How to deploy Public Group metadata

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

Written by Mateusz Kochanowicz

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 this:

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

How do Public Groups look in the comparison results?

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

From API version 62 onwards you can surface the description of a Group through the Metadata API.

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?

For example, in this org an assigned user 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.

This is because users are treated as data, not metadata. Therefore, the metadata API won't support it's retrieval. Which means that you would have to add this manually as a post-deployment step.
​

Note: A role and the places it's used are deployed differently:

  • A role itself is metadata. It's stored in the Role metadata type, which the Default comparison filter includes, so you can compare and deploy it.

  • Adding a role to a Public Group is data, in the same way as adding a user, so the Group metadata type doesn't retrieve it.

  • Assigning a role to a user is data, because the role is stored on the user's record.

Gearset's data deployments can't move group members or users either, because GroupMember and User are on the list of objects they don't deploy. Add them by hand in the target org after the deployment.

Did this answer your question?