---
name: smart-priority-scoring
description: "Automatically assign priority levels to support tickets based on customer tier, issue severity, SLA requirements, and business impact. Use when configuring dynamic priority scoring, setting SLA countdown timers, implementing VIP detection, or building composite priority algorithms. Triggers on phrases like 'ticket priority', 'auto-prioritize', 'SLA scoring', 'priority algorithm', 'VIP detection', 'severity scoring', 'dynamic priority', 'SLA countdown', 'breach prediction'."
---

# Smart Priority Scoring & SLA Management

Automatically assign and dynamically adjust ticket priority using a composite scoring algorithm that considers customer value, issue severity, sentiment, and SLA constraints.

## Workflow

### Phase 1: Scoring Model Design

1. **Define priority tiers** (P0 through P4):
   - P0 (Critical): System-wide outage, data loss, security breach, VIP customer blocked
   - P1 (High): Major feature broken, billing impact, senior executive affected
   - P2 (Medium): Partial functionality impaired, workaround available
   - P3 (Low): Minor issue, cosmetic, documentation request
   - P4 (Background): Feature request, general inquiry, feedback
2. **Build composite scoring factors**:
   - Customer tier weight (Enterprise 25%, Premium 20%, Standard 15%, Free 10%)
   - Issue severity weight (Critical 30%, High 25%, Medium 20%, Low 15%)
   - Sentiment score weight (negative/angry +5 points, neutral 0, positive -3)
   - Channel urgency weight (phone/live chat +10%, email +0%, portal -5%)
   - SLA remaining time (breach within 1 hour → auto-escalate)
   - Business impact flags (revenue impact, compliance risk, data exposure)
3. **Calibrate thresholds**:
   - Map composite score ranges to P0-P4 tiers
   - Set minimum/maximum overrides (security always P0, feedback always P3/P4)
   - Define SLA response/resolution time per priority tier

### Phase 2: Scoring Engine Implementation

1. **Real-time scoring pipeline**:
   - Trigger on ticket creation and on every reply/update
   - Fetch customer data from CRM (tier, contract status, health score)
   - Analyze ticket content (severity keywords, sentiment, urgency indicators)
   - Check SLA timers and business hours
   - Calculate composite score → assign priority tier
2. **Dynamic re-scoring**:
   - Re-evaluate priority on each customer reply (sentiment shift, new info)
   - Escalate if SLA breach within 2 hours
   - De-escalate if resolution found or customer indicates satisfaction
   - Log all priority changes with reason codes
3. **SLA timer management**:
   - Set countdown timers per priority tier
   - Pause timers outside business hours (configurable by region)
   - Send warning notifications at 50% and 25% SLA remaining
   - Auto-escalate at breach threshold

### Phase 3: Monitoring & Tuning

1. **Accuracy tracking**:
   - Compare auto-assigned priority vs. manual agent override
   - Target: <10% override rate
   - Track false positives (over-prioritized) and false negatives (under-prioritized)
2. **SLA compliance monitoring**:
   - Response time compliance by priority tier
   - Resolution time compliance by priority tier
   - Breach rate trending (weekly, monthly)
3. **Scoring model tuning**:
   - Monthly review of weight factors
   - A/B test new scoring parameters
   - Adjust based on agent feedback and customer outcomes

## Templates

### Priority Scoring Configuration

```
PRIORITY SCORING ENGINE CONFIGURATION
======================================
Version: [3.1] | Effective: [Date]

PRIORITY TIERS & SLA TARGETS:
┌──────┬───────────┬──────────────────┬──────────────────┬──────────────────────┐
│ Tier │ Label     │ Response Time    │ Resolution Time  │ Auto-Escalation      │
├──────┼───────────┼──────────────────┼──────────────────┼──────────────────────┤
│ P0   │ Critical  │ 15 minutes       │ 4 hours          │ Immediate → CTO      │
│ P1   │ High      │ 1 hour           │ 8 hours          │ 6 hours → Director   │
│ P2   │ Medium    │ 4 hours          │ 24 hours         │ 20 hours → Manager   │
│ P3   │ Low       │ 8 hours          │ 48 hours         │ 40 hours → Team Lead │
│ P4   │ Background│ 24 hours         │ 5 business days  │ None                 │
└──────┴───────────┴──────────────────┴──────────────────┴──────────────────────┘

SCORING FACTORS & WEIGHTS:
┌─────────────────────────┬────────┬──────────────────────────────┐
│ Factor                  │ Weight │ Scoring Logic                │
├─────────────────────────┼────────┼──────────────────────────────┤
│ Customer Tier           │ 25%    │ Enterprise=25, Premium=20,   │
│                         │        │ Standard=15, Free=10         │
│ Issue Severity          │ 30%    │ Critical=30, High=25,        │
│                         │        │ Medium=20, Low=15            │
│ Sentiment Score         │ 10%    │ Angry=+5, Negative=+3,       │
│                         │        │ Neutral=0, Positive=-3       │
│ Channel Urgency         │ 5%     │ Phone=+10, Live Chat=+5,     │
│                         │        │ Email=0, Portal=-5           │
│ Business Impact Flags   │ 15%    │ Revenue=+15, Compliance=+12, │
│                         │        │ Data Exposure=+18            │
│ Repeat Issue (same wk)  │ 10%    │ 2nd time=+5, 3rd+=+10        │
├─────────────────────────┴────────┼──────────────────────────────┤
│ SCORE → PRIORITY MAPPING:       │                              │
│ 70+ → P0 (Critical)             │                              │
│ 50-69 → P1 (High)               │                              │
│ 30-49 → P2 (Medium)             │                              │
│ 15-29 → P3 (Low)                │                              │
│ <15 → P4 (Background)           │                              │
└─────────────────────────────────┴──────────────────────────────┘

OVERRIDES (always apply):
- Security vulnerability → P0 regardless of score
- VIP flag active → minimum P1
- Feature request → maximum P3
- Documentation question → maximum P4
```

### Priority Scorecard (Per Ticket)

```
PRIORITY SCORECARD — Ticket #48305
===================================
Created: 2025-01-15 09:23 UTC | Last Updated: 2025-01-15 09:45 UTC

CUSTOMER PROFILE:
  Name: Acme Corp | Tier: Enterprise | Contract: Platinum
  Health Score: 72/100 (at risk) | MRR: $15,000/month
  Account Manager: Jane Smith

TICKET DETAILS:
  Subject: "Production database connection pool exhausted — all API calls failing"
  Channel: Phone (escalated from chat) | Language: English
  Keywords detected: "production", "all failing", "API down", "urgent"

SCORING BREAKDOWN:
  Customer Tier (Enterprise):         25 points
  Issue Severity (Critical):          30 points
  Sentiment (Frustrated/Urgent):       +5 points
  Channel (Phone):                    +10 points
  Business Impact (Revenue):          +15 points
  Repeat Issue (3rd this week):       +10 points
  ──────────────────────────────────────────────
  COMPOSITE SCORE: 95 → P0 CRITICAL

ASSIGNED PRIORITY: P0 — Critical
SLA Response: 15 minutes (12 minutes elapsed — ⚠ ON TRACK)
SLA Resolution: 4 hours
Auto-Escalation: Triggered at 4 hours → CTO notification
Escalation History: None (within SLA)

AGENT ASSIGNED: Mike Chen (Senior — Database Specialist)
Priority Change Log: Initial assignment → P0 (auto-scored)
```

## Integration Points

- **Ticketing systems**: Zendesk, Freshdesk, Intercom, Jira Service Desk
- **CRM**: Salesforce, HubSpot (customer tier, contract, health score)
- **SLA tools**: ServiceNow, Freshservice SLA module
- **Analytics**: Tableau, Power BI, Looker (SLA dashboards)
- **Notification**: Slack, PagerDuty, OpsGenie (escalation alerts)
- **Sentiment analysis**: AWS Comprehend, Google NLP, MonkeyLearn
- **Business hours**: Timezone APIs, holiday calendars
- **Account health**: Gainsight, Totango, Planhat (health scoring)

## Edge Cases

| Scenario | Handling |
|----------|----------|
| Customer tier changes mid-ticket | Re-score immediately; log priority change with reason |
| SLA breach imminent but no available agent | Auto-escalate to next management level; trigger on-call paging |
| Bulk incident (100+ similar tickets) | Auto-group into master incident; apply highest priority from group |
| After-hours P0 ticket | Page on-call engineer; bypass business hours pause |
| Priority dispute from agent | Allow agent override with mandatory reason code; log for review |
| Sentiment analysis false positive | Manual review threshold; allow agent correction |
| Customer downgrades (Enterprise → Free) mid-ticket | Maintain original priority for ticket lifecycle |
| VIP customer with minor issue | Apply VIP override (minimum P1) but allow de-escalation after resolution |

## Output

### Priority Scoring Dashboard

```
PRIORITY DISTRIBUTION — Real-Time View
=======================================
As of: 2025-01-15 10:30 UTC

ACTIVE TICKETS BY PRIORITY:
  P0 Critical:    3 tickets  [██░░░░░░░░] (1.2%)
  P1 High:       18 tickets  [█████░░░░░] (6.8%)
  P2 Medium:     87 tickets  [██████████░░] (33.1%)
  P3 Low:       112 tickets  [███████████████░] (42.6%)
  P4 Background: 28 tickets  [██░░░░░░░░] (10.6%)
  ─────────────────────────────────────
  Total:        248 tickets

SLA COMPLIANCE (Last 30 Days):
  P0 Response:  98.7%  [████████████████░░] Target: 99.0%
  P1 Response:  96.2%  [███████████████░░░] Target: 97.0%
  P2 Response:  94.8%  [███████████████░░░] Target: 95.0%
  P0 Resolution: 91.3% [██████████████░░░░] Target: 92.0%
  P1 Resolution: 89.7% [█████████████░░░░░] Target: 90.0%

BREACH RISK (Next 2 Hours):
  ⚠ 5 tickets approaching P1 response breach (avg 42 min remaining)
  ✓ No P0 breaches predicted

SCORING ACCURACY:
  Agent override rate: 8.3% (Target: <10%)
  Most overridden: P3 → P2 (customer history not captured)
```
