skills/csm/trending-topics/SKILL.md
Identify trending customer service topics by analyzing case patterns, channel distribution, and sentiment shifts across the CSM portfolio
npx skillsauth add happy-technologies-llc/happy-servicenow-skills trending-topicsInstall 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 identifies emerging and trending topics across the customer service portfolio by analyzing case creation patterns, category distributions, channel preferences, and sentiment shifts. It enables proactive support management by surfacing issues before they become widespread. It covers:
When to use: During daily standup reviews, weekly operational reporting, when investigating a suspected increase in case volume for a specific topic, or when proactively monitoring service health across the customer base.
Value proposition: Enables proactive support management by detecting emerging issues before they impact SLAs. Supports staffing decisions, knowledge gap identification, and product feedback loops with data-driven trend analysis.
com.sn_customerservice) must be activesn_customerservice_manager, csm_admin, or report_adminsn_customerservice_case, interaction, csm_consumer, and sys_journal_field tables; access to aggregate/stats APIsQuery case volumes for the current period and comparison period to detect deviations.
Using MCP (Claude Code/Desktop):
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()
fields: category,subcategory,product,priority,contact_type,state
limit: 500
For the comparison baseline (previous 7-day period):
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: opened_atBETWEENjavascript:gs.daysAgoStart(14)@javascript:gs.daysAgoEnd(7)
fields: category,subcategory,product,priority,contact_type,state
limit: 500
Using REST API:
GET /api/now/stats/sn_customerservice_case?sysparm_query=opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()&sysparm_group_by=category&sysparm_count=true
GET /api/now/stats/sn_customerservice_case?sysparm_query=opened_atBETWEENjavascript:gs.daysAgoStart(14)@javascript:gs.daysAgoEnd(7)&sysparm_group_by=category&sysparm_count=true
Use a background script to compute percentage changes and flag anomalies.
Using MCP:
Tool: SN-Execute-Background-Script
Parameters:
description: Calculate category volume changes between current and previous week
script: |
var categories = {};
var currentWeek = new GlideAggregate('sn_customerservice_case');
currentWeek.addQuery('opened_at', '>=', gs.daysAgoStart(7));
currentWeek.addAggregate('COUNT');
currentWeek.groupBy('category');
currentWeek.query();
while (currentWeek.next()) {
var cat = currentWeek.category.getDisplayValue() || 'Uncategorized';
categories[cat] = categories[cat] || { current: 0, previous: 0 };
categories[cat].current = parseInt(currentWeek.getAggregate('COUNT'));
}
var prevWeek = new GlideAggregate('sn_customerservice_case');
prevWeek.addQuery('opened_at', '>=', gs.daysAgoStart(14));
prevWeek.addQuery('opened_at', '<', gs.daysAgoStart(7));
prevWeek.addAggregate('COUNT');
prevWeek.groupBy('category');
prevWeek.query();
while (prevWeek.next()) {
var cat2 = prevWeek.category.getDisplayValue() || 'Uncategorized';
categories[cat2] = categories[cat2] || { current: 0, previous: 0 };
categories[cat2].previous = parseInt(prevWeek.getAggregate('COUNT'));
}
var results = [];
for (var c in categories) {
var pctChange = categories[c].previous > 0
? Math.round(((categories[c].current - categories[c].previous) / categories[c].previous) * 100)
: (categories[c].current > 0 ? 100 : 0);
results.push(c + ': ' + categories[c].current + ' (was ' + categories[c].previous + ', ' + pctChange + '% change)');
}
gs.info('Category Trends:\n' + results.join('\n'));
Using REST API:
GET /api/now/stats/sn_customerservice_case?sysparm_query=opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()&sysparm_group_by=category,subcategory&sysparm_count=true&sysparm_display_value=true
Determine which channels customers are using for trending topics to optimize staffing.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^category=[trending_category]
fields: contact_type,priority,state
limit: 200
Tool: SN-Query-Table
Parameters:
table_name: interaction
query: opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()
fields: channel,state,parent,opened_at
limit: 200
Using REST API:
GET /api/now/stats/sn_customerservice_case?sysparm_query=opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^category=[trending_category]&sysparm_group_by=contact_type&sysparm_count=true&sysparm_display_value=true
Break down trending topics by product to identify product-level issues.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^productISNOTEMPTY
fields: product,category,subcategory,priority,state
limit: 300
Using REST API:
GET /api/now/stats/sn_customerservice_case?sysparm_query=opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^productISNOTEMPTY&sysparm_group_by=product,category&sysparm_count=true&sysparm_display_value=true
Assess severity patterns to understand business impact of trending issues.
Using MCP:
Tool: SN-Execute-Background-Script
Parameters:
description: Analyze priority distribution for top trending categories
script: |
var trendingCategories = ['Portal Access', 'Billing', 'Performance'];
var results = [];
trendingCategories.forEach(function(cat) {
var ga = new GlideAggregate('sn_customerservice_case');
ga.addQuery('opened_at', '>=', gs.daysAgoStart(7));
ga.addQuery('category', cat);
ga.addAggregate('COUNT');
ga.groupBy('priority');
ga.query();
var priorities = {};
while (ga.next()) {
priorities[ga.priority.getDisplayValue()] = parseInt(ga.getAggregate('COUNT'));
}
results.push(cat + ': ' + JSON.stringify(priorities));
});
gs.info('Priority Distribution:\n' + results.join('\n'));
Using REST API:
GET /api/now/stats/sn_customerservice_case?sysparm_query=opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^category=[category]&sysparm_group_by=priority&sysparm_count=true&sysparm_display_value=true
Determine which customer segments are most affected by trending issues.
Using MCP:
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^category=[trending_category]
fields: account,consumer,priority,state
limit: 100
Cross-reference with account tiers:
Tool: SN-Query-Table
Parameters:
table_name: customer_account
query: sys_idIN[account_sys_ids_from_cases]
fields: sys_id,name,customer_tier,industry
limit: 50
Using REST API:
GET /api/now/table/sn_customerservice_case?sysparm_query=opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^category=[trending_category]&sysparm_fields=account,consumer,priority,state&sysparm_limit=100&sysparm_display_value=true
Compile all analysis into an executive-ready report.
=== TRENDING TOPICS REPORT ===
Period: Mar 12 - Mar 19, 2026
Generated: Mar 19, 2026
TOP TRENDING TOPICS (by volume change):
1. Portal Access Issues [SPIKE]
Volume: 87 cases (+145% vs. prev week)
Priority Mix: P1(5) P2(32) P3(45) P4(5)
Channel: Chat 45% | Phone 30% | Portal 20% | Email 5%
Products: Customer Portal v3.2 (78%), Mobile App (22%)
Segments: Gold accounts 40%, Silver 35%, Bronze 25%
Insight: Spike correlates with Portal v3.2.1 release on Mar 14
Action: Coordinate with Engineering on hotfix; draft KB article
2. Billing Discrepancies [RISING]
Volume: 42 cases (+35% vs. prev week)
Priority Mix: P2(12) P3(25) P4(5)
Channel: Phone 55% | Email 30% | Portal 15%
Products: Billing Module (100%)
Segments: Gold 60% (disproportionate)
Insight: Increase concentrated in enterprise accounts post rate change
Action: Review billing rule changes; proactive outreach to Gold accounts
3. Password Reset Failures [STABLE]
Volume: 28 cases (-5% vs. prev week)
Priority Mix: P3(20) P4(8)
Channel: Chat 60% | Portal 30% | Phone 10%
Insight: Consistent volume; candidate for self-service automation
Action: Review Virtual Agent deflection rates
EMERGING SIGNALS:
- "API timeout" mentions up 200% in case descriptions (12 cases)
- 3 Platinum accounts opened P1 cases for same integration error
- Chat channel usage up 15% overall (staffing review recommended)
RECOMMENDATIONS:
1. Deploy hotfix for Portal v3.2.1 session handling
2. Create proactive communication for billing rate change impact
3. Staff additional chat agents for peak hours (10am-2pm)
4. Investigate API timeout cluster for potential infrastructure issue
| Tool | When to Use |
|------|-------------|
| SN-NL-Search | Semantic search across case descriptions for emerging keyword patterns |
| SN-Query-Table | Structured aggregate queries for volume, channel, and priority analysis |
| SN-Read-Record | Deep-dive into specific trending cases for root cause analysis |
| SN-Execute-Background-Script | Complex aggregation and statistical calculations across large datasets |
| Endpoint | Method | Purpose |
|----------|--------|---------|
| /api/now/table/sn_customerservice_case | GET | Query cases for trend analysis |
| /api/now/stats/sn_customerservice_case | GET | Aggregate statistics by category, product, priority |
| /api/now/table/interaction | GET | Channel distribution analysis |
| /api/now/table/csm_consumer | GET | Consumer segment correlation |
| /api/now/table/sys_journal_field | GET | Text mining from case communications |
Cause: Query time range may not account for timezone differences or the case category taxonomy may have changed. Solution: Verify the time range uses server-side JavaScript functions. Check for recent category renames or merges that may split historical data.
Cause: The contact_type field on cases may differ from the channel field on interactions. Cases may be reclassified after creation.
Solution: Use interaction records for definitive channel data and case records for initial contact type. Reconcile discrepancies in the report.
Cause: Common words appearing in unrelated contexts. Solution: Use multi-word phrases and bigrams for keyword analysis. Require minimum frequency thresholds (e.g., 5+ occurrences) before flagging.
Cause: GlideAggregate may time out on very large case tables. Solution: Add date range filters to limit the dataset. Use the REST stats API which is optimized for aggregation. Consider scheduled reports for recurring analysis.
Scenario: Manager needs a quick 5-minute trend overview for the morning standup.
Tool: SN-Execute-Background-Script
Parameters:
description: Generate daily trend summary
script: |
var ga = new GlideAggregate('sn_customerservice_case');
ga.addQuery('opened_at', '>=', gs.daysAgoStart(1));
ga.addAggregate('COUNT');
ga.groupBy('category');
ga.orderByAggregate('COUNT', 'DESC');
ga.query();
var summary = 'Yesterday Case Volume by Category:\n';
while (ga.next()) {
summary += ga.category.getDisplayValue() + ': ' + ga.getAggregate('COUNT') + '\n';
}
gs.info(summary);
Scenario: Product manager requests trend analysis for a specific product after a release.
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: product=[product_sys_id]^opened_atONLast 14 days@javascript:gs.beginningOfLast14Days()@javascript:gs.endOfLast14Days()
fields: category,subcategory,priority,state,opened_at,short_description
limit: 200
Scenario: Detect if customer sentiment is deteriorating for a trending topic.
Tool: SN-Query-Table
Parameters:
table_name: sn_customerservice_case
query: category=[trending_category]^opened_atONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()^escalation>0
fields: number,short_description,escalation,priority,consumer,account
limit: 50
Escalation rate increase often correlates with negative sentiment shifts and can serve as a proxy when direct sentiment scores are unavailable.
csm/case-summarization - Summarize individual cases within trending topicscsm/sentiment-analysis - Detailed sentiment analysis for trend correlationcsm/sidebar-summarization - Agent context for trending issue casescsm/kb-generation - Generate KB articles for identified trending topicsreporting/dashboard-generation - Visualize trends on operational dashboardstesting
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