1. Case management — the CSM case lifecycle
“Walk me through what happens from the moment a customer submits a case in the portal to the moment it's resolved.”
How to answer
- The base table is sn_customer_service_case (extends task). A case must be linked to an Account and a Contact — that's how entitlement lookups work.
- State model: New → Open → Awaiting Info → Resolved → Closed. Assignment runs via matching rules or Advanced Work Assignment (AWA) when enabled.
- Every case check-in touches the SLA engine (contract_sla) and, if the account has an entitlement, records service consumption on service_entitlement.
- Closure requires resolution_code + resolution_notes; auto-close job (sn_customer_service.auto_close_resolved) moves Resolved → Closed after N days.
Reference script
// Before Insert BR on sn_customer_service_case
if (!current.account) {
gs.addErrorMessage('Case must be linked to an Account');
current.setAbortAction(true);
}
if (!current.contact) {
current.contact = new global.CSMContactResolver()
.findByEmail(current.contact_email);
}Pitfall
Creating cases without an Account. Entitlements, SLAs and reporting all key off Account — an orphan case skips billing and never counts toward a contract.