End-to-end Incident SLA setup for Service Cloud ITSM — creating a MilestoneType, an Incident-scoped SLA Policy (SlaProcess), attaching a Milestone with criteria, and wiring an Entitlement so Incidents derive an EntityMilestone with a computed TargetDate. Use when the user asks to configure SLA milestones on Incidents, create an SLA policy for Incident records, set up entitlement processes for ITSM, wire milestones so they appear on the Incident page, or enable SLA tracking for incident management. DO NOT TRIGGER when: the user asks about Case entitlements or Case SLA (not Incident), querying existing SLA policies without setup intent, general Entitlement sObject CRUD unrelated to Incident, or Milestone queries for reporting purposes only.
Configures a complete Incident SLA pipeline for Service Cloud ITSM — the chain that derives an
EntityMilestone (with a computed TargetDate) on every Incident with an Entitlement. Every operation
runs through the Salesforce-hosted headless-360 MCP server; the org is derived from the OAuth
JWT — the skill never handles an org id, alias, or credentials. It also needs the org-level SLA Management for IT
Service setup item (the Phase 0.5 gate — see below). Setup has four parts:
MilestoneType (what you measure) → SLA Policy (SlaProcess scoped to Incident, entry/exit
criteria) → Milestone (time trigger + filter criteria) → Entitlement (wired to an Account so
Incidents engage the SLA).
Scope
In scope: Creating MilestoneTypes, SLA Policies (SlaProcess), Milestones with criteria,
Entitlements, and verifying SLA engagement on Incident records — all via headless-360 MCP.
In scope — prerequisite: checking and (on consent) enabling SLA Management for IT Service
(Phase 0.5); halts if not fully enabled or consent declined.
In scope — predefined vs custom (Phase 0.6): offering the OOB Standard Support for Incidents
policy (Incident only) vs a custom one.
Out of scope: Case SLA/entitlements; Assignment Rules; Escalation Rules; Notification
Rules; general Entitlement CRUD not related to Incident SLA; SLA reporting.
Routes at a glance
Reads → mcp__headless-360__dispatch_readonly, writes → mcp__headless-360__dispatch. Both take raw
HTTP: {"url","method","body"?,"query_params"?} — not{operation_id, arguments}. Response
envelope: standard REST — read body from {status_code, body}. The full route table — create
MilestoneType / SLA Policy / Milestone, Entitlement, BusinessHours, test Incident, the Phase 0.5
feature calls, and the create-milestone-action op — with request/response shapes lives in
references/mcp-invocation.md.
Clarifying Questions
Ask only what you cannot infer from context (pre-populate; note "(from
conversation)"). Resolve the Phase 0.5 gate first.
Which org?headless-360 binds to the current OAuth session; confirm the target before mutating.
Milestone strategy? See Phase 1.4 (skipped per its skip conditions).
Target Account? For the Entitlement.
Milestone criteria? Default Status != Closed, plus pattern-specific filters.
Default suggestion: SLA Policy Incident SLA Policy, default BusinessHours, the Account the user
picks, Entitlement today → today + 1 year, milestone strategy resolved per Phase 1.4.
Workflow
All steps are sequential. Always read before you write. Every call goes through
mcp__headless-360__* tools.
Phase 0 — Reuse what the session already knows
Each Phase 1 read carries a skip-if-already-known clause: skip only when the same fact was
produced this session by a successful dispatch_readonly on the current org and unwritten since —
a user statement is never cache-eligible. Cacheable: master Incident Mgmt pref (step 1, only if
ENABLED), SLA feature + Versioning (Phase 0.5), Incident describe (3), BusinessHoursId (4), Account
id (5), SLA Connect ops indexed (2). When in doubt, re-check — a wrong skip on a live write is
worse than a re-read.
Phase 0.5 — SLA Management for IT Service prerequisite gate
Resolve this gate first, on its own. Reads are safe up front; confirm the org before any write.
"SLA Management for IT Service" is enabled only when both Simplified SLA Setup (feature
service-cloud-itsm-manage-sla-policies) and SLA Versioning
(EntitlementSettings.IsEntitlementVersioningEnabled) are on; either off → not enabled. The one
feature-enable turns on both, permanently enabling versioning — inseparable. Shapes /
enableBlockedReasons / ack wording: references/mcp-invocation.md.
Read both (dispatch_readonly); proceed to Phase 0.6 only when both are on.
On an OFF org, read the master license first (Phase 1 step 1, service-cloud-itsm-incident):
NOT_AVAILABLE → HALT — don't flip the permanent Versioning switch where Incident SLA can't run.
Two separate AskUserQuestion acks — never merge. (a) master Incident Mgmt NOT_ENABLED → ask
to enable it first (reversible, no permanence warning). (b) a distinct permanence ack: enabling
SLA Management turns on SLA Versioning, which can't be turned off (the feature disables
later but Versioning stays on). Offer enable/stop — no "versioning-off"; a bare "enable SLA"
is not consent.
Decline (b), non-empty enableBlockedReasons, or a re-read mismatch → HALT — enable no SLA
Mgmt/Versioning, don't proceed to Phase 0.6/1 (a reversible master enable from (a) stands). After
any write, re-read both and report the REAL state — never trust 201/204.
Phase 0.6 — Predefined (OOB) vs Custom
Once the gate passes, offer the OOB policy before any custom-flow questions. Incident only.
Prerequisite + detect. Confirm master Incident Mgmt pref ENABLED (Phase 1 step 1). Then dispatch_readonlyGET /connect/sla-management/sla-policies with
query_params.processTypes=Incident; match display name "Standard Support for Incidents".
Already present → no re-seed (no idempotency), no custom upsell; report it is seeded.
If warn/escalate actions were requested → resolve the named existing milestones → Phase 2.5 →
Phase 3 verify → STOP (attach actions even though the policy was already seeded).
Fork — one AskUserQuestion, Predefined listed first / recommended: use Salesforce's
predefined Incident SLA policy (Standard Support for Incidents — priority-tiered milestones)
or build a custom one. One-way note: predefined seeds an
active policy + Entitlement, no un-seed path (manual delete only).
MUST read references/mcp-invocation.md (Predefined Incident Policy) before seeding.
Phase 1 — Preflight & discovery
On any 401 / 403 / 404 from a step below, halt and surface the raw error — the org/client is misconfigured. 401 → MCP auth (ECA not propagated / expired token). 403 → user perm OR ITSM Incident Management license/pref missing (ITSMIncidentMgmtEnabled / IncidentMgmt.orgHasITSMOrgPermission). 404 → headless-360 not activated OR Entitlement Management not enabled for Incident.
Master Incident Management pref — direct read(skip conditions in Phase 0).
dispatch_readonlyGET .../connect/setup/discovery/features, filter features[] to the exactapiName == "service-cloud-itsm-incident" — never a look-alike (service-cloud-incident-management
is generic Case-based Incident Management, not our target). Read status: ENABLED → proceed;
NOT_AVAILABLE (license missing) → halt and surface it — cannot be enabled here, no delegate/ack;
NOT_ENABLED → explicit AskUserQuestion ack first (never auto-enable as an implied SLA
dependency), then delegate to service-itsm-incident-mgmt-configure inline (confirms-to-write) and
re-read; if declined, halt — every SLA artifact below depends on the master being on. Full shape + why
setup-org-preferences 404s here: references/mcp-invocation.md (Preflight A).
Discover the Connect operations — (skip if already verified this session — see Phase 0).
mcp__headless-360__discover(query="sla-management milestone") to confirm the SLA Management
Connect API is indexed, then mcp__headless-360__describe(id=<operation_id>)
for the milestone-types, sla-policies, and sla-policies/{id}/milestones POST operations to pull
their exact input schemas + HTTP routes. If discover returns nothing after rewording the query,
the corpus does not index this surface for the org — direct the user to Setup → SLA/Entitlement
setup and stop.
Verify Incident Management + SLA fields — (skip if Incident.describe result for the
current org is already in context — see Phase 0). Otherwise dispatch_readonly on
GET /services/data/v67.0/sobjects/Incident/describe and confirm fields[] includes
EntitlementId, SlaStartDate, SlaExitDate. If the describe 404s or fields are missing, direct
the user to enable Entitlement Management for Incident and stop.
Find default BusinessHours — (skip if BusinessHoursId for the current org's default is
already captured this session). Otherwise dispatch_readonly on GET /services/data/v67.0/query with
query_params.q="SELECT Id, Name FROM BusinessHours WHERE IsActive = true AND IsDefault = true".
If body.records is empty, stop with a message to create default Business Hours in Setup. Capture
BusinessHoursId.
Resolve the target Account — (skip if already resolved this session). Phase 2's Entitlement
needs an AccountId. If the user named one → look up (SELECT Id, Name FROM Account WHERE Name = '<escaped>' LIMIT 1); not found → stop and ask, never substitute. If the user authorized
any/existing Account → pick the most recently active (... WHERE IsDeleted = false ORDER BY LastModifiedDate DESC LIMIT 1) and surface which in the plan. Otherwise → ask via
AskUserQuestion: list real candidates by name only + "type a name"; never auto-pick,
pre-select, or expose an internal sort key (e.g. recency). If none exists, stop. Capture AccountId + name.
Read existing SLA artifacts (idempotency probe) — dispatch_readonly SOQL for SlaProcess by
name (... WHERE Name = '<name>' AND SobjectType = 'Incident' — the field is SobjectType;
ProcessType returns INVALID_FIELD), each MilestoneType the strategy would create,
SlaMilestone under the matched policy, and Entitlement by name on the resolved Account. If
every artifact already exists with the requested config, set noOp=true and skip Phase 1.4 +
Phase 2 (skip condition (b)); any missing/divergent artifact → proceed to Phase 1.4.
Phase 1.4 — Milestone Strategy
Every SLA policy needs at least one milestone. Load examples/milestone-patterns.md — it lists the
skip conditions (concrete shape in prompt / idempotent no-op / explicit up-front authorization) and
the five strategy options with their AskUserQuestion prompt, defaults, and MilestoneType-reuse
rules. Skip condition (c) still requires Phase 1.5 plan-narration before dispatch. Multi-milestone
selection expands to N creates in Phase 2 step 10 (one POST per milestone, order 1..N, same SlaProcess).
Phase 1.5 — Confirm before mutating
Confirm the plan — present the resolved config (target org, SLA Policy name, resolved
Account name, Entitlement date range, and the full per-milestone list — never collapse
Priority-tiered / Custom to "N milestones"). Skip the AskUserQuestion (but still narrate the
plan before dispatch) when up-front authorization was granted (note (authorized in prompt)), the
branch is a no-op, or it was already confirmed in conversation (note (confirmed in conversation));
otherwise require an explicit "yes" before Phase 2. Everything before this step is read-only;
everything after mutates the org.
Phase 2 — Create SLA Artifacts (exact order — each depends on the previous)
Create MilestoneType(s) — POST /connect/sla-management/milestone-types. One POST per
distinct MilestoneType required by the strategy. Reuse a single MilestoneType across milestones
that share a name (Priority-tiered "First Response" reuses one MilestoneType across all four
milestones); create separate MilestoneTypes for distinct concerns (Response + Resolution =
two MilestoneTypes; Escalation ladder = three). Capture each id.
Create SLA Policy — POST /connect/sla-management/sla-policies with processType='Incident'
and the businessHourId from Phase 1. Capture id. The response echoes nulls — verify via
SOQL, not the response body.
Attach Milestone(s) — load the request-body template from assets/attach-milestone.json
and, for each milestone in the strategy, populate milestoneTypeId, timeTrigger, order
(1..N in the strategy's order) and any per-pattern filterItems additions from
examples/milestone-patterns.md, then POST /connect/sla-management/sla-policies/<slaId>/milestones.
Each milestoneCriteria[] item needs milestoneAgreementType (SLA/OLA) and
filterType: RuleFilter. Do not put slaProcessId in the body — carried by the path.
Multi-milestone strategies dispatch once per milestone; on any milestone POST failure, halt
and surface the raw error — do not continue with a half-attached policy.
Create Entitlement — POST /sobjects/Entitlement linking the resolved Account (from Phase 1
step 5), the SLA Policy (SlaProcessId), and Business Hours. For immediate engagement, backdate
StartDate to yesterday.
Phase 2-OOB — Seed the Predefined Incident Policy
Reached only from Phase 0.6 Predefined (replaces Phase 1.4/1.5/2). Follow the seed recipe
in references/mcp-invocation.md (Predefined Incident Policy) with the template in
assets/predefined-incident-policy.json — it uses the Phase 2 routes (2 MilestoneTypes → SLA
Policy active:true → 8 priority-tiered milestones → Entitlement), validates each Priority/Status
against the live picklist, and avoids the Connect activate PATCH. Then run Phase 2.5 (if actions
requested), then Phase 3 (Critical test Incident), and STOP — no proactive custom offer.
After milestones exist (Phase 2 or 2-OOB), only if the user asked to warn/escalate/notify: apply
the requested checkpoint(s) to every milestone the user named (not just one), computing each
offset from that milestone's own target. Map "warn at X%" → an offset before target, "on breach" →
at/after it; confirm the full set before writing (up-front auth waives the re-ask; narrate it
regardless — no headless delete), then, per milestone, delegate to headless
create-milestone-action (discover → describe → dispatch). Confirm each from the response
body (success + non-empty actionMappings; a timed checkpoint also returns a triggerId), never
the 201. Formula, roles, proven body, defaults, and the IST business-hours note:
references/mcp-invocation.md (Milestone Actions).
Phase 3 — Verify
Verify the SLA Policy — SOQL on SlaProcess (do not trust the create response).
Create a test Incident with EntitlementId set to the new Entitlement. For Priority-tiered
strategies, set a Priority that matches at least one milestone's criteria (or one test Incident
per Priority) — otherwise no EntityMilestone spawns even with the policy wired correctly.
Verify engagement — SOQL confirming Incident.SlaStartDate is populated and the expected
EntityMilestone row(s) exist with correct TargetDate(s) — one per milestone whose criteria
the Incident satisfies.
Report results using the output format below.
Rules / Constraints
Constraint
Rationale
Gate on SLA Management for IT Service first (Phase 0.5) — one enable turns on the feature and, one-way, SLA Versioning; two separate acks (master, then permanence) — never merged; decline / blocked / verify-fail → HALT, no fall-through; re-read + report real state
Versioning can't be undone; writes don't confirm state
Offer the predefined (OOB) policy first (Phase 0.6, Incident only); detect before seed; if chosen, seed → verify → STOP (no custom upsell)
OOB seed has no server idempotency (re-seeding duplicates)
Discover + describe before any mutation
Catches a missing SLA surface / disabled Incident Management early
Ask (via AskUserQuestion) which milestone strategy to use — don't silently default to Single
Real ITSM policies usually have >1 milestone; a silent default hides it
Reuse one MilestoneType per shared name; create a distinct one per distinct concern
The runtime keys milestones by MilestoneType — sharing collapses distinct concerns
For multi-milestone strategies, halt on any milestone POST failure (no half-attached policy)
Partial attach diverges from the confirmed plan
Priority-tiered: validate every Priority value against the live Incident picklist before dispatch
The server accepts any string on filterItems.value — an unknown value silently makes the milestone dead code
Entitlement is standard sObject DML (not Connect API); StartDate controls status (future = Inactive)
Not part of the /connect/sla-management/ surface
Verify SLA Policy via SOQL, not the create response
The create response echoes nulls
Never show record IDs in any message, incl. interim narration — the test Incident by IncidentNumber, milestones by MilestoneType name, never the 15/18-char Id; keep AskUserQuestion labels customer-facing (no "demo", "the skill", internal defaults)
Leaked Ids and internal/demo framing look unprofessional
Additional API quirks (payload rules, operator enum, missing-criteria error): references/mcp-invocation.md.
Verification Checklist
SLA Management gated (Phase 0.5) — feature + SLA Versioning both on, only after the permanence ack (separate from the master ack); reported state matches a re-read, not the write. If it couldn't be enabled (declined / blocked / verify-fail), the run HALTED before Phase 0.6/1 — no artifacts.
Predefined vs Custom offered (Phase 0.6) — with the feature ON, the OOB Standard Support for Incidents policy was offered first; if it existed, reported not re-seeded; if chosen, seeded (2 MilestoneTypes + 8 tiered milestones + Entitlement), verified, no custom offer followed.
Master Incident Mgmt pref (exact service-cloud-itsm-incident) confirmed ENABLED via a live read, or delegated to service-itsm-incident-mgmt-configure when NOT_ENABLED (NOT_AVAILABLE → HALT) — not a user assertion, not a look-alike.
discover/describe (or the Incident describe) confirmed the SLA Connect operations.
Incident describe returned 200 with EntitlementId, SlaStartDate, SlaExitDate.
Default BusinessHours found.
Milestone strategy resolved — via a Phase 1.4 skip condition OR AskUserQuestion; for Priority-tiered / Custom, every Priority/criteria value was validated against the live Incident picklist before dispatch.
Configuration confirmed OR skip condition met (up-front authorization / no-op / prior confirmation / explicit "yes"); the resolved plan (org, SLA name, account, entitlement range, per-milestone list) was narrated before Phase 2.
Artifacts created in order (MilestoneType(s) → Policy → Milestone(s) → Entitlement); each POST 201; any milestone POST failure halted the run (no partial attach). Trivial on no-op runs.
Milestone actions (Phase 2.5) — if requested, attached to every named milestone; each confirmed from body.success + actionMappings, not the 201; full set narrated before write.
SLA Policy verified via SOQL, not the create response (on no-op, the Phase-1 read is the verification).
Test Incident has SlaStartDate populated (Priority chosen to match a criterion for Priority-tiered) and ≥1 EntityMilestone with the correct TargetDate; expected milestone(s) present for multi-milestone. Skip on no-op.
Before/after + summary shown; on no-op, the summary states the pre-existing configuration verbatim and reports "no changes made".
Output Format
See examples/output-templates.md for the canonical failure / single-milestone success / multi-milestone success templates. Fill in the placeholders as-is. No files are produced — the skill mutates org configuration in place through headless-360 MCP dispatch.
Reference File Index
File
When to read
references/mcp-invocation.md
Every phase — exact mcp__headless-360__* call shapes, payload templates, response envelope, discovery, and gotchas (filter-operator enum, v67 routes, entitlement behavior)
examples/milestone-patterns.md
Phase 1.4 — the five milestone strategies with default times, criteria, MilestoneType reuse rules, and per-pattern filter-item extensions
Phase 2 step 10 — request-body template for the milestone POST (sla-policies/<slaId>/milestones); substitute milestoneTypeId, businessHoursId, timeTrigger, order; append per-pattern filterItems
assets/predefined-incident-policy.json
Phase 0.6 / Phase 2-OOB — the OOB Standard Support for Incidents seed template (policy + 2 MilestoneTypes + 8 priority-tiered milestones)
assets/attach-milestone-action.json
Phase 2.5 — Warn/Escalate milestone-action body templates (Field Update); pair with references/mcp-invocation.md (Milestone Actions)
Related Skills
The priority matrix (Impact × Urgency → Priority) is separate — service-itsm-incident-priority-configure;
if a Priority-tiered strategy is requested but Incident.Priority is missing values, direct the user
there first. Other adjacent ITSM flows (Major Incident Mgmt, custom fields on Incident/Problem/ChangeRequest)
are out of scope.
1---2name: service-itsm-agentic-setup-incident-sla-configure3description: End-to-end Incident SLA setup for Service Cloud ITSM — creating a MilestoneType, an Incident-scoped SLA Policy (SlaProcess), attaching a Milestone with criteria, and wiring an Entitlement so Incidents derive an EntityMilestone with a computed TargetDate. Use when the user asks to configure SLA milestones on Incidents, create an SLA policy for Incident records, set up entitlement processes for ITSM, wire milestones so they appear on the Incident page, or enable SLA tracking for incident management. DO NOT TRIGGER when: the user asks about Case entitlements or Case SLA (not Incident), querying existing SLA policies without setup intent, general Entitlement sObject CRUD unrelated to Incident, or Milestone queries for reporting purposes only.4---56# Configuring Incident SLA (End-to-End)
78Configures a complete **Incident SLA pipeline** for Service Cloud ITSM — the chain that derives an
9EntityMilestone (with a computed TargetDate) on every Incident with an Entitlement. Every operation
10runs through the Salesforce-hosted **`headless-360`** MCP server; the org is derived from the OAuth
11JWT — the skill never handles an org id, alias, or credentials. It also needs the org-level **SLA Management for IT
12Service** setup item (the Phase 0.5 gate — see below). Setup has four parts:
13**MilestoneType** (what you measure) → **SLA Policy** (SlaProcess scoped to Incident, entry/exit
14criteria) → **Milestone** (time trigger + filter criteria) → **Entitlement** (wired to an Account so
15Incidents engage the SLA).
1617## Scope
1819- **In scope**: Creating MilestoneTypes, SLA Policies (SlaProcess), Milestones with criteria,
20 Entitlements, and verifying SLA engagement on Incident records — all via `headless-360` MCP.
21- **In scope — prerequisite**: checking and (on consent) enabling **SLA Management for IT Service**
22 (Phase 0.5); halts if not fully enabled or consent declined.
23- **In scope — predefined vs custom** (Phase 0.6): offering the OOB *Standard Support for Incidents*
24 policy (Incident only) vs a custom one.
25- **Out of scope**: Case SLA/entitlements; Assignment Rules; Escalation Rules; Notification
26 Rules; general Entitlement CRUD not related to Incident SLA; SLA reporting.
2728---
2930## Routes at a glance
3132Reads → `mcp__headless-360__dispatch_readonly`, writes → `mcp__headless-360__dispatch`. Both take raw
33HTTP: `{"url","method","body"?,"query_params"?}` — **not** `{operation_id, arguments}`. **Response
34envelope**: standard REST — read `body` from `{status_code, body}`. The full route table — create
35MilestoneType / SLA Policy / Milestone, Entitlement, BusinessHours, test Incident, the Phase 0.5
36feature calls, and the `create-milestone-action` op — with request/response shapes lives in
37`references/mcp-invocation.md`.
3839---
4041## Clarifying Questions
4243Ask only what you cannot infer from context (pre-populate; note "(from
44conversation)"). **Resolve the Phase 0.5 gate first.**
4546- **Which org?** `headless-360` binds to the current OAuth session; confirm the target before mutating.
47- **Milestone strategy?** See Phase 1.4 (skipped per its skip conditions).
48- **Target Account?** For the Entitlement.
49- **Milestone criteria?** Default `Status != Closed`, plus pattern-specific filters.
5051Default suggestion: SLA Policy `Incident SLA Policy`, default BusinessHours, the Account the user
52picks, Entitlement `today → today + 1 year`, milestone strategy resolved per Phase 1.4.
5354---
5556## Workflow
5758All steps are sequential. **Always read before you write.** Every call goes through
59`mcp__headless-360__*` tools.
6061### Phase 0 — Reuse what the session already knows
6263Each Phase 1 read carries a **skip-if-already-known** clause: skip only when the same fact was
64produced **this session** by a successful `dispatch_readonly` on the current org and unwritten since —
65a user statement is never cache-eligible. Cacheable: master Incident Mgmt pref (step 1, only if
66`ENABLED`), SLA feature + Versioning (Phase 0.5), Incident describe (3), `BusinessHoursId` (4), Account
67id (5), SLA Connect ops indexed (2). **When in doubt, re-check** — a wrong skip on a live write is
68worse than a re-read.
6970### Phase 0.5 — SLA Management for IT Service prerequisite gate
7172**Resolve this gate first, on its own. Reads are safe up front; confirm the org before any write.**
73"SLA Management for IT Service" is enabled only when **both** Simplified SLA Setup (feature
74`service-cloud-itsm-manage-sla-policies`) **and** SLA Versioning
75(`EntitlementSettings.IsEntitlementVersioningEnabled`) are on; either off → not enabled. The one
76feature-`enable` turns on both, **permanently** enabling versioning — inseparable. Shapes /
77`enableBlockedReasons` / ack wording: `references/mcp-invocation.md`.
7879- **Read both** (`dispatch_readonly`); proceed to Phase 0.6 **only when both are on**.
80- **On an OFF org, read the master license first** (Phase 1 step 1, `service-cloud-itsm-incident`):
81 `NOT_AVAILABLE` → **HALT** — don't flip the permanent Versioning switch where Incident SLA can't run.
82- **Two separate `AskUserQuestion` acks — never merge.** (a) master Incident Mgmt `NOT_ENABLED` → ask
83 to enable it first (reversible, no permanence warning). (b) a *distinct* permanence ack: enabling
84 **SLA Management** turns on **SLA Versioning**, which **can't be turned off** (the feature disables
85 later but Versioning stays on). Offer **enable**/**stop** — no "versioning-off"; a bare "enable SLA"
86 is **not** consent.
87- **Decline (b), non-empty `enableBlockedReasons`, or a re-read mismatch → HALT** — enable no SLA
88 Mgmt/Versioning, don't proceed to Phase 0.6/1 (a reversible master enable from (a) stands). **After
89 any write, re-read both and report the REAL state** — never trust `201`/`204`.
9091### Phase 0.6 — Predefined (OOB) vs Custom
9293Once the gate passes, offer the OOB policy **before** any custom-flow questions. **Incident only.**
94951. **Prerequisite + detect.** Confirm master Incident Mgmt pref `ENABLED` (Phase 1 step 1). Then `dispatch_readonly` `GET /connect/sla-management/sla-policies` with
96 `query_params.processTypes=Incident`; match display name **"Standard Support for Incidents"**.
97 - **Already present** → **no re-seed** (no idempotency), no custom upsell; report it is seeded.
98 **If warn/escalate actions were requested → resolve the named existing milestones → Phase 2.5 →
99 Phase 3 verify → STOP** (attach actions even though the policy was already seeded).
1002. **Fork** — one `AskUserQuestion`, **Predefined listed first / recommended**: use Salesforce's
101 predefined Incident SLA policy (*Standard Support for Incidents* — priority-tiered milestones)
102 **or** build a custom one. One-way note: predefined seeds an
103 **active** policy + Entitlement, no un-seed path (manual delete only).
104 - **Predefined →** resolve BusinessHours + Account (Phase 1 steps 4–5) → **Phase 2-OOB** → **Phase
105 2.5** (if actions requested) → Phase 3 verify → **STOP**.
106 - **Custom →** existing Phase 1 → 1.4 → 1.5 → 2 → 3, unchanged.
107108**MUST read `references/mcp-invocation.md` (Predefined Incident Policy) before seeding.**
109110### Phase 1 — Preflight & discovery
111112**On any `401` / `403` / `404` from a step below, halt and surface the raw error** — the org/client is misconfigured. `401` → MCP auth (ECA not propagated / expired token). `403` → user perm OR ITSM Incident Management license/pref missing (`ITSMIncidentMgmtEnabled` / `IncidentMgmt.orgHasITSMOrgPermission`). `404` → `headless-360` not activated OR Entitlement Management not enabled for Incident.
1131141. **Master Incident Management pref — direct read** *(skip conditions in Phase 0)*.
115 `dispatch_readonly` `GET .../connect/setup/discovery/features`, filter `features[]` to the **exact**
116 `apiName == "service-cloud-itsm-incident"` — never a look-alike (`service-cloud-incident-management`
117 is generic Case-based Incident Management, not our target). Read `status`: `ENABLED` → proceed;
118 `NOT_AVAILABLE` (license missing) → **halt and surface it** — cannot be enabled here, no delegate/ack;
119 `NOT_ENABLED` → **explicit `AskUserQuestion` ack first (never auto-enable as an implied SLA
120 dependency)**, then delegate to `service-itsm-incident-mgmt-configure` inline (confirms-to-write) and
121 re-read; if declined, halt — every SLA artifact below depends on the master being on. Full shape + why
122 setup-org-preferences 404s here: `references/mcp-invocation.md` (Preflight A).
1232. **Discover the Connect operations** — *(skip if already verified this session — see Phase 0)*.
124 `mcp__headless-360__discover(query="sla-management milestone")` to confirm the SLA Management
125 Connect API is indexed, then `mcp__headless-360__describe(id=<operation_id>)`
126 for the `milestone-types`, `sla-policies`, and `sla-policies/{id}/milestones` POST operations to pull
127 their exact input schemas + HTTP routes. If `discover` returns nothing after rewording the query,
128 the corpus does not index this surface for the org — direct the user to **Setup → SLA/Entitlement
129 setup** and stop.
1303. **Verify Incident Management + SLA fields** — *(skip if `Incident.describe` result for the
131 current org is already in context — see Phase 0)*. Otherwise `dispatch_readonly` on
132 `GET /services/data/v67.0/sobjects/Incident/describe` and confirm `fields[]` includes
133 `EntitlementId`, `SlaStartDate`, `SlaExitDate`. If the describe 404s or fields are missing, direct
134 the user to enable Entitlement Management for Incident and stop.
1354. **Find default BusinessHours** — *(skip if `BusinessHoursId` for the current org's default is
136 already captured this session)*. Otherwise `dispatch_readonly` on `GET /services/data/v67.0/query` with
137 `query_params.q="SELECT Id, Name FROM BusinessHours WHERE IsActive = true AND IsDefault = true"`.
138 If `body.records` is empty, stop with a message to create default Business Hours in Setup. Capture
139 `BusinessHoursId`.
1405. **Resolve the target Account** — *(skip if already resolved this session)*. Phase 2's Entitlement
141 needs an `AccountId`. If the user **named** one → look up (`SELECT Id, Name FROM Account WHERE Name
142 = '<escaped>' LIMIT 1`); not found → **stop and ask**, never substitute. If the user **authorized
143 any/existing Account** → pick the most recently active (`... WHERE IsDeleted = false ORDER BY
144 LastModifiedDate DESC LIMIT 1`) and **surface which** in the plan. Otherwise → **ask via
145 `AskUserQuestion`**: list real candidates by **name only** + "type a name"; **never auto-pick,
146 pre-select, or expose an internal sort key** (e.g. recency). If none exists, stop. Capture `AccountId` + name.
1476. **Read existing SLA artifacts (idempotency probe)** — `dispatch_readonly` SOQL for `SlaProcess` by
148 name (`... WHERE Name = '<name>' AND SobjectType = 'Incident'` — the field is `SobjectType`;
149 `ProcessType` returns `INVALID_FIELD`), each `MilestoneType` the strategy would create,
150 `SlaMilestone` under the matched policy, and `Entitlement` by name on the resolved Account. If
151 **every** artifact already exists with the requested config, set `noOp=true` and skip Phase 1.4 +
152 Phase 2 (skip condition (b)); any missing/divergent artifact → proceed to Phase 1.4.
153154### Phase 1.4 — Milestone Strategy
155156Every SLA policy needs at least one milestone. Load `examples/milestone-patterns.md` — it lists the
157skip conditions (concrete shape in prompt / idempotent no-op / explicit up-front authorization) and
158the five strategy options with their `AskUserQuestion` prompt, defaults, and MilestoneType-reuse
159rules. Skip condition (c) still requires Phase 1.5 plan-narration before dispatch. Multi-milestone
160selection expands to N creates in Phase 2 step 10 (one POST per milestone, `order` 1..N, same SlaProcess).
161162### Phase 1.5 — Confirm before mutating
1631647. **Confirm the plan** — present the resolved config (target **org**, **SLA Policy** name, resolved
165 **Account** name, **Entitlement** date range, and the **full per-milestone list** — never collapse
166 Priority-tiered / Custom to "N milestones"). **Skip the `AskUserQuestion`** (but still narrate the
167 plan before dispatch) when up-front authorization was granted (note `(authorized in prompt)`), the
168 branch is a no-op, or it was already confirmed in conversation (note `(confirmed in conversation)`);
169 otherwise require an explicit "yes" before Phase 2. Everything before this step is read-only;
170 everything after mutates the org.
171172### Phase 2 — Create SLA Artifacts (exact order — each depends on the previous)
1731748. **Create MilestoneType(s)** — `POST /connect/sla-management/milestone-types`. One POST per
175 distinct MilestoneType required by the strategy. Reuse a single MilestoneType across milestones
176 that share a name (Priority-tiered "First Response" reuses one MilestoneType across all four
177 milestones); create separate MilestoneTypes for distinct concerns (Response + Resolution =
178 two MilestoneTypes; Escalation ladder = three). Capture each `id`.
1799. **Create SLA Policy** — `POST /connect/sla-management/sla-policies` with `processType='Incident'`
180 and the `businessHourId` from Phase 1. Capture `id`. **The response echoes nulls — verify via
181 SOQL, not the response body.**
18210. **Attach Milestone(s)** — load the request-body template from `assets/attach-milestone.json`
183 and, for each milestone in the strategy, populate `milestoneTypeId`, `timeTrigger`, `order`
184 (1..N in the strategy's order) and any per-pattern `filterItems` additions from
185 `examples/milestone-patterns.md`, then `POST /connect/sla-management/sla-policies/<slaId>/milestones`.
186 Each `milestoneCriteria[]` item needs `milestoneAgreementType` (`SLA`/`OLA`) and
187 `filterType: RuleFilter`. Do **not** put `slaProcessId` in the body — carried by the path.
188 Multi-milestone strategies dispatch once per milestone; on any milestone POST failure, halt
189 and surface the raw error — do not continue with a half-attached policy.
19011. **Create Entitlement** — `POST /sobjects/Entitlement` linking the resolved Account (from Phase 1
191 step 5), the SLA Policy (`SlaProcessId`), and Business Hours. For immediate engagement, backdate
192 `StartDate` to yesterday.
193194### Phase 2-OOB — Seed the Predefined Incident Policy
195196Reached only from Phase 0.6 Predefined (replaces Phase 1.4/1.5/2). Follow the seed recipe
197in `references/mcp-invocation.md` (**Predefined Incident Policy**) with the template in
198`assets/predefined-incident-policy.json` — it uses the **Phase 2 routes** (2 MilestoneTypes → SLA
199Policy `active:true` → 8 priority-tiered milestones → Entitlement), validates each `Priority`/`Status`
200against the live picklist, and avoids the Connect activate PATCH. Then run **Phase 2.5** (if actions
201requested), then **Phase 3** (Critical test Incident), and **STOP** — no *proactive* custom offer.
202203### Phase 2.5 — Milestone Actions (optional: Warn / Escalate)
204205After milestones exist (Phase 2 or 2-OOB), **only if** the user asked to warn/escalate/notify: apply
206the requested checkpoint(s) to **every milestone the user named** (not just one), computing each
207offset from that milestone's own target. Map "warn at X%" → an offset *before* target, "on breach" →
208*at/after* it; **confirm the full set before writing** (up-front auth waives the re-ask; narrate it
209regardless — no headless delete), then, per milestone, delegate to headless
210**`create-milestone-action`** (`discover` → `describe` → `dispatch`). **Confirm each from the response
211body** (`success` + non-empty `actionMappings`; a *timed* checkpoint also returns a `triggerId`), never
212the `201`. Formula, roles, proven body, defaults, and the IST business-hours note:
213`references/mcp-invocation.md` (Milestone Actions).
214215### Phase 3 — Verify
21621712. **Verify the SLA Policy** — SOQL on `SlaProcess` (do not trust the create response).
21813. **Create a test Incident** with `EntitlementId` set to the new Entitlement. For Priority-tiered
219 strategies, set a `Priority` that matches at least one milestone's criteria (or one test Incident
220 per Priority) — otherwise no `EntityMilestone` spawns even with the policy wired correctly.
22114. **Verify engagement** — SOQL confirming `Incident.SlaStartDate` is populated and the expected
222 `EntityMilestone` row(s) exist with correct `TargetDate`(s) — one per milestone whose criteria
223 the Incident satisfies.
22415. **Report results** using the output format below.
225226---
227228## Rules / Constraints
229230| Constraint | Rationale |
231|-----------|-----------|
232| Gate on **SLA Management for IT Service** first (Phase 0.5) — one enable turns on the feature **and**, one-way, **SLA Versioning**; **two separate acks (master, then permanence) — never merged**; decline / blocked / verify-fail → **HALT, no fall-through**; re-read + report real state | Versioning can't be undone; writes don't confirm state |
233| Offer the **predefined (OOB)** policy first (Phase 0.6, Incident only); detect before seed; if chosen, seed → verify → **STOP** (no custom upsell) | OOB seed has no server idempotency (re-seeding duplicates) |
234| Discover + describe before any mutation | Catches a missing SLA surface / disabled Incident Management early |
235| Ask (via `AskUserQuestion`) which milestone strategy to use — don't silently default to Single | Real ITSM policies usually have >1 milestone; a silent default hides it |
236| Reuse one MilestoneType per shared name; create a distinct one per distinct concern | The runtime keys milestones by MilestoneType — sharing collapses distinct concerns |
237| For multi-milestone strategies, halt on any milestone POST failure (no half-attached policy) | Partial attach diverges from the confirmed plan |
238| Priority-tiered: validate every `Priority` value against the live Incident picklist before dispatch | The server accepts any string on `filterItems.value` — an unknown value silently makes the milestone dead code |
239| Entitlement is standard sObject DML (not Connect API); `StartDate` controls status (future = Inactive) | Not part of the `/connect/sla-management/` surface |
240| Verify SLA Policy via SOQL, not the create response | The create response echoes nulls |
241| Never show record IDs **in any message, incl. interim narration** — the test Incident by **IncidentNumber**, milestones by **MilestoneType name**, never the 15/18-char Id; keep `AskUserQuestion` labels customer-facing (no "demo", "the skill", internal defaults) | Leaked Ids and internal/demo framing look unprofessional |
242243Additional API quirks (payload rules, operator enum, missing-criteria error): `references/mcp-invocation.md`.
244245---
246247## Verification Checklist
248249- [ ] **SLA Management gated (Phase 0.5)** — feature + SLA Versioning both on, only after the **permanence ack** (separate from the master ack); reported state matches a re-read, not the write. If it couldn't be enabled (declined / blocked / verify-fail), the run **HALTED** before Phase 0.6/1 — no artifacts.
250- [ ] **Predefined vs Custom offered (Phase 0.6)** — with the feature ON, the OOB *Standard Support for Incidents* policy was offered first; if it existed, reported not re-seeded; if chosen, seeded (2 MilestoneTypes + 8 tiered milestones + Entitlement), verified, **no** custom offer followed.
251- [ ] Master Incident Mgmt pref (exact `service-cloud-itsm-incident`) confirmed `ENABLED` via a live read, or delegated to `service-itsm-incident-mgmt-configure` when `NOT_ENABLED` (`NOT_AVAILABLE` → HALT) — not a user assertion, not a look-alike.
252- [ ] `discover`/`describe` (or the Incident describe) confirmed the SLA Connect operations.
253- [ ] Incident describe returned 200 with `EntitlementId`, `SlaStartDate`, `SlaExitDate`.
254- [ ] Default BusinessHours found.
255- [ ] **Milestone strategy resolved** — via a Phase 1.4 skip condition OR `AskUserQuestion`; for Priority-tiered / Custom, every `Priority`/criteria value was validated against the live Incident picklist before dispatch.
256- [ ] **Configuration confirmed OR skip condition met** (up-front authorization / no-op / prior confirmation / explicit "yes"); the resolved plan (org, SLA name, account, entitlement range, per-milestone list) was narrated before Phase 2.
257- [ ] Artifacts created in order (MilestoneType(s) → Policy → Milestone(s) → Entitlement); each POST 201; any milestone POST failure halted the run (no partial attach). Trivial on no-op runs.
258- [ ] **Milestone actions (Phase 2.5)** — if requested, attached to **every** named milestone; each confirmed from `body.success` + `actionMappings`, not the `201`; full set narrated before write.
259- [ ] SLA Policy verified via SOQL, not the create response (on no-op, the Phase-1 read is the verification).
260- [ ] Test Incident has `SlaStartDate` populated (Priority chosen to match a criterion for Priority-tiered) and ≥1 EntityMilestone with the correct TargetDate; expected milestone(s) present for multi-milestone. Skip on no-op.
261- [ ] Before/after + summary shown; on no-op, the summary states the pre-existing configuration verbatim and reports "no changes made".
262263---
264265## Output Format
266267See `examples/output-templates.md` for the canonical failure / single-milestone success / multi-milestone success templates. Fill in the placeholders as-is. No files are produced — the skill mutates org configuration in place through headless-360 MCP dispatch.
268269---
270271## Reference File Index
272273| File | When to read |
274|------|--------------|
275| `references/mcp-invocation.md` | Every phase — exact `mcp__headless-360__*` call shapes, payload templates, response envelope, discovery, and gotchas (filter-operator enum, v67 routes, entitlement behavior) |
276| `examples/milestone-patterns.md` | Phase 1.4 — the five milestone strategies with default times, criteria, MilestoneType reuse rules, and per-pattern filter-item extensions |
277| `examples/output-templates.md` | Output Format — canonical failure / single-milestone success / multi-milestone success templates |
278| `assets/attach-milestone.json` | Phase 2 step 10 — request-body template for the milestone POST (`sla-policies/<slaId>/milestones`); substitute `milestoneTypeId`, `businessHoursId`, `timeTrigger`, `order`; append per-pattern `filterItems` |
279| `assets/predefined-incident-policy.json` | Phase 0.6 / Phase 2-OOB — the OOB *Standard Support for Incidents* seed template (policy + 2 MilestoneTypes + 8 priority-tiered milestones) |
280| `assets/attach-milestone-action.json` | Phase 2.5 — Warn/Escalate milestone-action body templates (Field Update); pair with `references/mcp-invocation.md` (Milestone Actions) |
281282---
283284## Related Skills
285286The priority matrix (Impact × Urgency → Priority) is separate — `service-itsm-incident-priority-configure`;
287if a Priority-tiered strategy is requested but `Incident.Priority` is missing values, direct the user
288there first. Other adjacent ITSM flows (Major Incident Mgmt, custom fields on Incident/Problem/ChangeRequest)
289are out of scope.
Run npx skillmds@latest add gabrielmoreira/service-itsm-agentic-setup-incident-sla-configure in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
End-to-end Incident SLA setup for Service Cloud ITSM — creating a MilestoneType, an Incident-scoped SLA Policy (SlaProcess), attaching a Milestone with criteria, and wiring an Entitlement so Incidents derive an EntityMilestone with a computed TargetDate. Use when the user asks to configure SLA milestones on Incidents, create an SLA policy for Incident records, set up entitlement processes for ITSM, wire milestones so they appear on the Incident page, or enable SLA tracking for incident management. DO NOT TRIGGER when: the user asks about Case entitlements or Case SLA (not Incident), querying existing SLA policies without setup intent, general Entitlement sObject CRUD unrelated to Incident, or Milestone queries for reporting purposes only. It is listed under DevOps & Infra on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
gabrielmoreira (@gabrielmoreira) published this skill. Their other Agent Skills are listed on their SkillMD profile.