本文へ移動
cccskills
無料GitHub で公開

queues-and-public-groups

Use this skill when creating or managing queues, configuring queue membership, setting up case or lead queues, creating public groups, or using groups in sharing rules and manual sharing. Trigger keywords: queue, public group, queue membership, queue email, group sharing, case queue, lead queue. NOT for the rule that decides which queue a record lands in — use admin/assignment-rules. NOT for Omni-Channel routing configuration — use admin/omni-channel-routing-setup.

インストール方法を見る

含まれるファイル(9)

  • SKILL.md18.6 KB
  • references/examples.md5.3 KB
  • references/gotchas.md8.9 KB
  • references/llm-anti-patterns.md9.3 KB
  • references/metadata-examples.md5.4 KB
  • references/queue-behaviour-matrix.md5.5 KB
  • references/well-architected.md5.5 KB
  • scripts/check_queues.py14.2 KB
  • templates/queues-and-public-groups-template.md3.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Queues and Public Groups

This skill activates when an admin needs to create or manage queues (which own records and route work to teams) or public groups (which aggregate members for access sharing, sharing rules, and list view visibility). Use it alongside the assignment-rules skill when records must be routed to queues automatically.


Before Starting

Gather this context before working in this domain:

  • Which objects are involved? Queues only work with objects that have queue support enabled: Case, Lead, Order, and custom objects explicitly configured for queues. Standard objects like Account, Contact, and Opportunity do not support queue ownership.
  • What is the goal — routing work or sharing access? Queues are for routing records to a pool of workers. Public groups are for granting shared access via sharing rules or manual sharing. The two mechanisms are distinct and should not be substituted for each other.
  • Understand org sharing model first. Public group utility depends on the org-wide default (OWD) setting. If OWD is Public Read/Write for an object, groups add no incremental access. Groups are most valuable in Private or Public Read Only OWDs.
  • Platform limit on sharing recalculation. Deeply nested public groups (groups containing groups containing groups) trigger expensive sharing recalculation jobs when membership changes. Prefer flat group structures in high-volume orgs.

Questions to Ask Before Configuring

AskWhy it mattersWhat a good answer adds
"Who works this pool, and how does that list change?"Named users churn; roles and public groups maintain themselvesMembership that survives onboarding and offboarding
"Which objects will the queue own?"A queue owns only the objects in queueSobject; rules and Omni-Channel targeting it for another object failOne queue per work pool
"Who should be notified of a new record: shared mailbox, every member, nobody?"email and doesSendEmailToMembers are independent switchesA notification people read instead of filter
"Is Omni-Channel pushing from this queue?"Without a routing configuration the queue is a list viewThe link into the routing stack
"What happens to queue-owned records when the queue is retired?"Records are strandedA retirement step in the runbook

A proper queue adds a pool that follows the org chart, a notification channel someone reads, manager visibility by design, and a routing target every rule can name by developer name. Full matrix: references/queue-behaviour-matrix.md.


Core Concepts

Queues

A queue is a special type of record owner that represents a pool of users, rather than a single individual. Records assigned to a queue are visible to all queue members through the queue's list view. Any queue member can claim ownership by changing the record's Owner field to themselves.

Supported objects for queues: Case, Lead, Order, and custom objects where "Allow Queues" is checked on the object definition. Account, Contact, Opportunity, and most other standard objects do not support queue ownership.

Queue membership types: A queue can include individual Users, Roles, Roles and Internal Subordinates, and Public Groups. Adding a Role automatically includes all users in that role; Roles and Internal Subordinates also includes users in roles below it in the hierarchy, internal users only. This group was labelled "Roles and Subordinates" before the Secure Roles release update — see references/gotchas.md Gotcha 6 before writing metadata or SOQL against it.

Queue email: Each queue can have a single email address (individual address or distribution list). When a record is assigned to the queue, Salesforce sends a notification to that address. Individual queue members do not receive individual email notifications — only the queue email is triggered. Configure this address to reach the whole team, not a single person.

Accepting work from a queue: Queue-owned records are in a shared pool. A team member claims a record by changing the Owner field to themselves. Until claimed, the owner remains the queue. Records owned by a queue appear in list views scoped to that queue, not in any individual's "My Open Cases" or "My Leads" view.

SOQL for queue-owned records: Use WHERE Owner.Type = 'Queue' to filter records owned by any queue. To filter by a specific queue name: WHERE Owner.Name = 'Tier 1 Support Queue'. Note that OwnerId alone does not distinguish user-owned from queue-owned records — Owner.Type is required.

Public Groups

A public group is a named collection of members used to grant access and control visibility. Unlike a queue, a public group does not own records — it only aggregates membership for sharing purposes.

Member types a public group can include: Users, Roles, Roles and Internal Subordinates, other Public Groups, and Portal Users (Customer Portal or Partner Portal users when Communities/Experience Cloud is enabled). This composition flexibility allows a single group to span organizational boundaries.

Uses of public groups:

  • Sharing rules: Both criteria-based and ownership-based sharing rules can target a public group as the "share with" recipient.
  • Manual sharing: Users with the Share button on a record can manually share to a public group.
  • Queue membership: A queue can include a public group as one of its member types, inheriting all the group's members.
  • List view visibility: List views can be shared with a public group, controlling which users see which views.
  • Email alerts in Flow/Process Builder: Email alerts can address a public group, sending the alert to all group members.

Nested groups: Public groups can contain other public groups. Nesting allows hierarchical structures but increases the cost of sharing recalculation. Every membership change triggers Salesforce to recompute all sharing rows for all objects with sharing rules that reference the group. In orgs with millions of records and complex group nesting, this recalculation can lock objects for extended periods. Flat group membership (direct users and roles) is preferred in high-volume orgs.

Queues vs Public Groups

These two constructs serve different purposes and should not be substituted for each other:

AspectQueuePublic Group
Can own recordsYes — record OwnerId can be a Queue IdNo — groups cannot own records
Supported objectsCase, Lead, Order, queue-enabled custom objectsAny object (for sharing, not ownership)
Used for sharing rulesNo (indirectly — as queue member)Yes — primary use case
Used for routing workYes — primary use caseNo
Sends queue email notificationYes — single address per queueNo
Member typesUsers, Roles, Roles + Internal Subordinates, GroupsUsers, Roles, Roles + Internal Subordinates, Groups, Portal Users

Common Patterns

Pattern: Tiered Support Queues with Escalation

When to use: A support team handles cases at multiple levels of complexity. Tier 1 agents handle general inquiries; Tier 2 specialists handle complex or escalated cases. Records should enter Tier 1 first and escalate to Tier 2 when needed.

How it works:

  1. Create a queue named Tier 1 Support for the Case object. Add Tier 1 agents as members. Configure a queue email (e.g., support-t1@company.com).
  2. Create a queue named Tier 2 Support for the Case object. Add Tier 2 specialists as members. Configure a separate queue email.
  3. Configure a Case Assignment Rule (see assignment-rules skill) to route new cases to Tier 1 Support.
  4. Use an Escalation Rule or a Flow to detect when a case has been open in Tier 1 too long, then change the Owner to Tier 2 Support.
  5. Tier 2 agents see the escalated case in their queue list view and claim ownership.

Why not assign directly to a user: Queue-based routing allows any available team member to claim work, preventing bottlenecks when a specific agent is unavailable.

Pattern: Regional Public Group for Sharing Rules

When to use: Sales reps in EMEA need read access to Opportunities owned by other EMEA reps, but the org-wide default for Opportunity is Private. Assignment-rules would not solve this — the reps still need cross-user read access without changing ownership.

How it works:

  1. Create a public group named EMEA Sales Team. Add all EMEA sales users directly, or add the EMEA Sales Role to include all role members automatically.
  2. Navigate to Setup → Sharing Settings → Opportunity Sharing Rules → New.
  3. Select rule type: Ownership-based. "Owned by members of" → EMEA Sales Team. "Share with" → EMEA Sales Team. Access: Read Only.
  4. Salesforce recalculates sharing and grants all EMEA reps read access to each other's Opportunities.
  5. When a new rep joins EMEA, add them to the group (or the role) and sharing is automatically extended.

Why not use a Role hierarchy: Role hierarchy grants upward visibility (managers see subordinates' records) but not peer visibility. A sharing rule with a public group grants horizontal access among peers in the group.


Decision Guidance

SituationRecommended ApproachReason
Route Cases or Leads to a team poolQueue on Case or Lead objectQueues own records; team members claim from shared pool
Grant read/write access to a group of usersPublic Group + Sharing RuleGroups aggregate membership; sharing rules grant access
Custom object needs team-based ownershipEnable queues on object, then create queueCustom objects require explicit queue enablement in Setup
Need to share a Salesforce list view with a teamPublic Group (assign list view to group)List view visibility is controlled by public group membership
Email a team when a record is assignedQueue email on the queueSingle address notified on queue assignment
Email an entire team from a Flow email alertPublic Group as alert recipientEmail alerts can target public groups, reaching all members
Object is Account, Contact, or OpportunityPublic Group (for sharing rules) onlyThese objects do not support queue ownership
Member changes cause slow sharing recalculationFlatten group structure, reduce nesting depthEach nested group multiplies recalculation scope

Recommended Workflow

Step-by-step instructions for an AI agent or practitioner working in this domain:

  1. Clarify the goal — determine whether the need is record routing (queue) or access sharing (public group). Confirm which object is involved and whether it supports queues.
  2. Create the queue or public group in Setup — for queues: Setup → Queues → New; configure supported objects, queue email, and members. For groups: Setup → Public Groups → New; add members by type (user, role, group).
  3. Configure downstream use — for queues: set up an assignment rule or Flow to route records to the queue. For public groups: create a sharing rule that references the group, or assign list views to the group.
  4. Validate membership — confirm all intended users are reachable through the membership chain (direct, via role, or via nested group). Deactivated users should be removed from queue membership to avoid stale ownership pools.
  5. Test the queue email — assign a test record to the queue and confirm the queue email receives a notification.
  6. Run the checker script — python3 skills/admin/queues-and-public-groups/scripts/check_queues.py --manifest-dir <metadata-dir> to surface any Group metadata references for review, including sharing rules still using the pre-Secure-Roles <roleAndSubordinates> element. It recurses, so --manifest-dir can be the project root or a build root and it still finds every queues/ and groups/ directory beneath. Exit 1 is an ERROR (a file that will not parse); queue-configuration findings are WARNs that exit 0 unless you add --strict.
  7. Confirm SOQL uses Owner.Type — any report or query on queue-owned records must use Owner.Type = 'Queue'; plain OwnerId checks will not distinguish queues from users.

Review Checklist

Run through these before marking queue or public group configuration complete:

  • Queue is associated with the correct supported objects (Case, Lead, Order, or queue-enabled custom object)
  • Queue email is a team alias or distribution list — not an individual's inbox
  • All queue members are active users; deactivated users have been removed
  • Public group member composition is intentional — Roles vs Roles and Internal Subordinates distinction reviewed
  • Sharing rules referencing the public group have been tested by logging in as an intended member
  • Nested group depth is reviewed — prefer flat membership in orgs with more than 1M records per shared object
  • SOQL queries on queue-owned records use Owner.Type = 'Queue' filter
  • Reports and dashboards that count queue-owned records are validated — owner-grouped reports must account for queue ownership

Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

  1. Queue-owned records show queue name as Owner in reports — Owner Name, Owner Email, and Owner Role fields reflect the queue, not a user. Reports grouped by Owner or dashboards using Owner-based filters will show the queue name as a row, separate from any user's data. Rollup summaries and assignment-based reports may undercount or misattribute records until ownership is accepted by a user.
  2. Deleting a queue does not reassign records — If a queue is deleted while it still owns records, those records become unowned or orphaned in some report contexts. Reassign all queue-owned records to a user or another queue before deleting a queue. Use a SOQL query (WHERE Owner.Name = 'Queue Name') to find affected records first.
  3. "Roles and Subordinates" was renamed to "Roles and Internal Subordinates" — the Secure Roles release update changed the default role-hierarchy sharing group so that enabling Digital Experiences no longer exposes those records to external site users. Enforced in sandboxes in Summer '25, and in production in Winter '26 — but production enforcement was scoped to orgs created after 8 February 2024 that had not enabled digital experiences, so an older org may still show the old label until it takes the release update. Check Setup → Release Updates in the target org first. Metadata <sharedTo><roleAndSubordinates> becomes <roleAndSubordinatesInternal>, and SOQL/API references to the RoleAndSubordinates group become RoleAndSubordinatesInternal. Salesforce translates old references dynamically for a transition period only; manual updates are still required. See references/gotchas.md Gotcha 6.
  4. Deactivated users remain in queue membership until removed — Salesforce does not auto-remove deactivated users from queues. The queue still accepts assignments, still shows the deactivated user in its membership list, and still sends queue email to the configured address. This causes confusion when teams assume the membership is clean. Audit queue membership during every user deactivation.

Output Artifacts

ArtifactDescription
Configured queueQueue with supported objects, queue email, and verified membership
Configured public groupNamed group with correct member composition for its intended sharing or visibility use
Sharing ruleCriteria-based or ownership-based rule referencing the public group
SOQL patternWHERE Owner.Type = 'Queue' filter for queue-owned record queries
Checker script outputList of Group metadata references found in the project metadata for review

Reference Files

FileRead it when
references/queue-behaviour-matrix.mdChoosing membership sources, objects, notifications, and visibility, with the questions to ask first
references/metadata-examples.mdWriting deployable Queue and Group XML and the package.xml for them
references/gotchas.mdThe six behaviours that cause most queue incidents

Related Skills

  • assignment-rules — use to route records automatically to queues based on criteria; queues must exist before assignment rules can target them
  • sharing-and-visibility — broader sharing model design, including OWD settings, role hierarchy, and criteria-based sharing rules that use public groups
  • escalation-rules — time-based re-routing of cases between queues when SLA is breached
  • user-management — queue membership requires active users; deactivation workflows should include queue membership cleanup

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use this skill when writing test-first, behavior-driven acceptance criteria in Given/When/Then format for a Salesforce user story. Covers happy path, edge cases, negative paths, permission boundaries, and data-state preconditions so the AC block can drive UAT scripts and Apex test design downstream. Trigger keywords: given when then, gherkin, behavior driven AC, test first acceptance criteria, scenario outline, BDD acceptance criteria. NOT for the user-story format itself (use admin/user-story-writing-for-salesforce). NOT for UAT script writing (use admin/uat-test-case-design). NOT for Apex test method generation (use agents/test-class-generator). NOT for high-level UAT planning (use admin/uat-and-acceptance-criteria). More triggers: acceptance criteria record, ac_id, req_id on a criterion, artefact under test, negative case for a rule-type requirement, no-match fall-through criterion, oracle for a Then clause, test type apex flow manual, criteria linter, check_ac_format.py, --manifest-dir.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Task and Event objects: polymorphic WhatId/WhoId, Activity object model, ActivityHistory vs OpenActivity, activity timeline customization, bulk task creation, Einstein Activity Capture boundaries. NOT for turning on EAC or calendar sync — use admin/einstein-activity-capture-setup. NOT for Email-to-Case — use admin/case-management-setup. Covers ActivitiesSettings metadata, enableActivities, shared Task/Event custom fields and FLS, TaskStatus value sets, Shared Activities and TaskRelation/EventRelation, recurring and child activities, and partial-success bulk DML on Task.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Design Invocable Apex actions that return deterministic, agent-friendly errors instead of surfacing raw exceptions to the LLM. NOT for authoring the action itself — @InvocableMethod schema, labels, security context — use agentforce/custom-agent-actions-apex. NOT for the Apex tests that force each error branch — use agentforce/agent-action-unit-tests.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Use when designing how an Agentforce agent extracts structured input parameters (slots) from a user's natural-language utterance to invoke an action. Triggers: 'agent extract date from user', 'agent action argument extraction', 'agentforce slot filling', 'agent invocable input mapping', 'agent fails to fill required parameter'. NOT for action authoring (use agentforce/agent-actions) or for prompt-template variable binding (use agentforce/prompt-builder-templates).

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Apex test patterns for @InvocableMethod agent actions: per-reason-code branch coverage, bulk safety, callout mocking, deterministic assertions. NOT for testing whether the agent routes to the right topic or answers well — use agentforce/agent-testing-and-evaluation. NOT for designing the error envelope the tests assert on — use agentforce/agent-action-error-handling.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Designing or reviewing Agentforce actions: Flow actions, Apex invocable actions, prompt-template actions, action naming, input and output contracts, confirmation requirements, and safe error behavior. Triggers: 'agent actions', 'build an agent that can look up an order', 'make the agent able to check order status', 'give the agent a capability', 'agent that can retrieve a record', 'flow action for agent', 'agent invocable action', 'action schema design'. NOT for writing the Apex class itself — use agentforce/custom-agent-actions-apex. NOT for the reason_code error envelope that stops an agent retry loop — use agentforce/agent-action-error-handling.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

PranavNagrecha のスキルをすべて見る

このスキルの問題を報告する