skills/itsm/incident-sentiment/SKILL.md
Analyze incident sentiment from work notes, customer communications, and activity entries to track escalation risk and customer satisfaction
npx skillsauth add happy-technologies-llc/happy-servicenow-skills incident-sentimentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill analyzes the sentiment of incident-related communications -- work notes, additional comments, email correspondence, and activity log entries -- to detect negative trends, predict escalation risk, and track customer satisfaction throughout the incident lifecycle.
When to use: When monitoring active incidents for escalation risk, analyzing customer satisfaction patterns, or building proactive intervention workflows for at-risk tickets.
itil, incident_manager, or analytics_admincom.snc.incident (Incident Management)incident, sys_journal_field, sn_si_incident, sys_audit, sys_emailQuery active incidents, prioritizing those with recent activity or approaching SLA breach.
Using MCP (Claude Code/Desktop):
Tool: SN-NL-Search
Parameters:
table_name: incident
query: "active incidents with priority 1 or 2 that have been updated in the last 24 hours"
fields: sys_id,number,short_description,priority,state,assigned_to,assignment_group,sla_due,sys_updated_on
limit: 30
Using REST API:
GET /api/now/table/incident?sysparm_query=active=true^priorityIN1,2^sys_updated_onONLast 24 hours@javascript:gs.daysAgoStart(1)@javascript:gs.daysAgoEnd(0)&sysparm_fields=sys_id,number,short_description,priority,state,assigned_to,assignment_group,sla_due,sys_updated_on&sysparm_limit=30
Extract all journal entries (work notes and additional comments) for each incident.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sys_journal_field
query: element_id=[incident_sys_id]^elementINwork_notes,comments^ORDERBYsys_created_on
fields: sys_id,element,value,sys_created_by,sys_created_on
limit: 50
Using REST API:
GET /api/now/table/sys_journal_field?sysparm_query=element_id=[incident_sys_id]^elementINwork_notes,comments^ORDERBYsys_created_on&sysparm_fields=sys_id,element,value,sys_created_by,sys_created_on&sysparm_limit=50
Check for email correspondence related to the incident.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sys_email
query: instance=[incident_sys_id]^type=received
fields: sys_id,subject,body_text,sender,sys_created_on
limit: 20
Using REST API:
GET /api/now/table/sys_email?sysparm_query=instance=[incident_sys_id]^type=received&sysparm_fields=sys_id,subject,body_text,sender,sys_created_on&sysparm_limit=20
Analyze each text entry and assign a sentiment classification:
| Sentiment | Score Range | Indicators | |-----------|-----------|------------| | Critical | -1.0 to -0.7 | Threats, profanity, executive escalation mentions, legal references | | Negative | -0.7 to -0.3 | Frustration, repeated complaints, urgency language, ALL CAPS | | Neutral | -0.3 to 0.3 | Factual updates, status checks, technical information | | Positive | 0.3 to 0.7 | Appreciation, acknowledgment, satisfaction expressed | | Very Positive | 0.7 to 1.0 | Explicit praise, issue resolved to satisfaction |
Negative sentiment keywords and phrases:
| Category | Keywords / Phrases | Weight | |----------|-------------------|--------| | Frustration | "still not working", "again", "how many times", "unacceptable" | -0.4 | | Urgency | "ASAP", "immediately", "critical", "business impact", "revenue loss" | -0.3 | | Escalation intent | "manager", "supervisor", "escalate", "executive", "CIO" | -0.5 | | Dissatisfaction | "disappointed", "poor service", "no response", "ignored" | -0.4 | | Threats | "legal", "contract", "SLA penalty", "vendor review" | -0.6 | | Repeat contact | "calling again", "third time", "follow up again" | -0.3 |
Positive sentiment keywords and phrases:
| Category | Keywords / Phrases | Weight | |----------|-------------------|--------| | Gratitude | "thank you", "appreciate", "great job", "helpful" | +0.4 | | Resolution | "fixed", "working now", "resolved", "all good" | +0.5 | | Acknowledgment | "understand", "makes sense", "will try that" | +0.2 |
Compute an overall escalation risk score based on sentiment trajectory:
escalation_risk = (current_sentiment * 0.40)
+ (sentiment_trend * 0.25)
+ (sla_proximity * 0.20)
+ (reassignment_count * 0.15)
Where:
| Risk Level | Score | Recommended Action | |-----------|-------|-------------------| | Low | 0.0-0.3 | Continue normal handling | | Moderate | 0.3-0.5 | Monitor more frequently | | High | 0.5-0.7 | Notify team lead, consider proactive outreach | | Critical | 0.7-1.0 | Immediate manager intervention required |
Query the structured incident intelligence table for additional signals.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_si_incident
query: incident=[incident_sys_id]
fields: sys_id,incident,sentiment_score,customer_effort_score,escalation_likelihood
limit: 1
Using REST API:
GET /api/now/table/sn_si_incident?sysparm_query=incident=[incident_sys_id]&sysparm_fields=sys_id,incident,sentiment_score,customer_effort_score,escalation_likelihood&sysparm_limit=1
Produce a per-incident sentiment analysis report:
Using MCP:
Tool: SN-Add-Work-Notes
Parameters:
sys_id: [incident_sys_id]
work_notes: |
=== SENTIMENT ANALYSIS REPORT ===
Incident: [number]
Analysis Date: [current_date]
Entries Analyzed: [count]
SENTIMENT TIMELINE:
[timestamp] Comment (Customer): NEGATIVE (-0.6)
"This is the third time I've called about this issue..."
[timestamp] Work Note (Agent): NEUTRAL (0.1)
"Reassigned to Network team for further investigation"
[timestamp] Comment (Customer): CRITICAL (-0.8)
"I need this escalated to management immediately..."
CURRENT SENTIMENT: CRITICAL (-0.8)
SENTIMENT TREND: Worsening (declined -0.4 over 48 hours)
ESCALATION RISK: HIGH (0.78)
RISK FACTORS:
- Customer used escalation language ("management", "escalate")
- Third contact about same issue (repeat contact indicator)
- SLA at 85% consumed with no resolution path identified
- Two reassignments in 48 hours
RECOMMENDED ACTIONS:
1. Immediate callback from team lead or manager
2. Provide clear timeline for resolution
3. Offer interim workaround if available
4. Document escalation handling in work notes
Analyze sentiment across multiple incidents for pattern detection.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: incident
query: active=true^assignment_group=[group_sys_id]
fields: sys_id,number,priority,state,assignment_group,sys_updated_on
limit: 100
Aggregate metrics:
| Metric | Value | Benchmark | |--------|-------|-----------| | Avg sentiment score | -0.22 | -0.10 | | Incidents with negative sentiment | 34% | 20% | | Critical sentiment incidents | 8% | 3% | | Sentiment-predicted escalations | 12 | -- | | Actual escalations (validated) | 10 | -- | | Prediction accuracy | 83% | -- |
Define thresholds for automated sentiment-based alerts:
Using MCP:
Tool: SN-Update-Record
Parameters:
table_name: incident
sys_id: [incident_sys_id]
data:
work_notes: "SENTIMENT ALERT: Escalation risk score exceeded 0.7. Automated notification sent to incident manager. Customer sentiment has declined from neutral to critical over the last 3 interactions."
urgency: 1
| Tool | Purpose | When to Use |
|------|---------|-------------|
| SN-NL-Search | Find incidents using natural language criteria | Initial discovery |
| SN-Query-Table | Retrieve journal entries, emails, incident data | Core data gathering |
| SN-Update-Record | Flag at-risk incidents, update urgency | Proactive intervention |
| SN-Add-Work-Notes | Document sentiment analysis findings | Reports and audit trail |
| SN-Get-Table-Schema | Explore table structures for sentiment data | Setup and discovery |
Cause: Work notes and comments are stored in sys_journal_field with the incident's sys_id as element_id
Solution: Verify the query uses element_id (not sys_id) to match the incident record. Also check that journal entries exist -- new incidents may not have any yet.
Cause: Technical jargon, abbreviations, or domain-specific language can confuse sentiment analysis Solution: Build a domain-specific keyword dictionary. Terms like "kill the process" or "terminate the session" are technical actions, not negative sentiment.
Cause: Thresholds are too sensitive or not calibrated to your environment Solution: Analyze historical escalation data. Raise thresholds gradually until false positive rate drops below 15%. Consider requiring multiple consecutive negative entries before alerting.
Cause: Emails are stored with HTML markup in sys_email
Solution: Strip HTML tags before sentiment analysis. Focus on body_text rather than body field, or apply HTML-to-text conversion.
Incident: INC0056789 - "Email server is down for marketing department"
Sentiment Timeline:
Escalation Risk: 0.82 (CRITICAL) Action: Incident manager called customer within 15 minutes. Provided timeline and workaround. Prevented formal executive escalation.
Incident: INC0056790 - "Cannot access shared drive from VPN"
Sentiment Timeline:
Escalation Risk: 0.05 (LOW) Action: No intervention needed. Incident resolved with positive customer outcome.
Incident: INC0056791 - "Printer on 4th floor not printing"
Sentiment Timeline:
Escalation Risk: 0.61 (HIGH) Action: Alert sent to team lead. Agent called customer, arranged loaner printer, escalated repair.
itsm/incident-triage - Triage with sentiment-informed prioritizationitsm/suggested-steps - Generate resolution steps for at-risk incidentscsm/sentiment-analysis - Customer service management sentiment analysishrsd/sentiment-analysis - HR case sentiment analysisitsm/major-incident - Major incident management with stakeholder communicationtesting
Manage supplier onboarding, qualification, performance monitoring, and offboarding with auditable lifecycle controls
tools
Identify emerging risks, prioritize intake signals, and route candidates into formal GRC risk assessment workflows
documentation
Screen inbound documents for completeness, policy risk, and routing readiness before extraction or case workflows
testing
Generate concise task summaries with status, timeline, blockers, SLA risk, and recommended next actions