Features
Reporting & Analytics Guide
This guide covers the 13 reporting and analytics tools. Read tools require no special flags. Scheduled job write tools require WRITE_ENABLED=true.
Tool Overview
| Tool | Description | API Used | Permission |
|---|---|---|---|
list_reports | List saved reports | Table API (sys_report) | Read |
get_report | Get report definition | Table API | Read |
run_aggregate_query | GROUP BY query with COUNT/SUM | Stats API (/api/now/stats/{table}) | Read |
trend_query | Monthly trend data | Stats API (date bucketing) | Read |
get_performance_analytics | PA widget data | PA API (/api/now/pa/widget/{sys_id}) | Read |
export_report_data | Structured data export | Table API | Read |
get_sys_log | System log entries | Table API (sys_log) | Read |
list_scheduled_jobs | Scheduled jobs list | Table API (sys_trigger) | Read |
get_scheduled_job | Get a scheduled job record | Table API (sysauto) | Read |
create_scheduled_job | Create a new scheduled script | Table API (sysauto_script) | Write |
update_scheduled_job | Update schedule or script | Table API (sysauto) | Write |
trigger_scheduled_job | Force immediate execution | Table API (sysauto) PATCH | Write |
list_job_run_history | Execution history log | Table API (sysauto_trigger_log) | Read |
Report Generation (PDF & PPTX)
NowAIKit can generate branded PDF documents and PPTX slide decks from any capability analysis. Reports include severity charts, findings tables, priority recommendations, and clickable links to your ServiceNow instance.
Clickable Entity Linking
Every entity in the report is automatically linked to your instance:
| Entity Type | Example | Links To |
|---|---|---|
| Record numbers | INC0010042, CHG0040012, PRB0000089 | Record detail page |
| System properties | glide.ui.session_timeout, glide.security.use_csrf_token | sys_properties record |
| Scoped properties | sn_cmdb.health.enabled, sn_hr_core.config | sys_properties record |
| Plugin IDs | com.snc.cmdb, com.glide.email | v_plugin record |
| Table names | sys_audit, cmdb_ci_server, sc_req_item | sys_db_object definition |
The generate_report Tool
generate_report:
content: <markdown from any capability>
format: pdf # or pptx
title: "Instance Health Scan"
capability: scan-health # optional — used in filename
# Returns: { file_path, size_bytes, format }
What's in a Report
- Branded cover page — instance URL, scan date, capability name, NowAIKit logo
- Executive summary — overall score and key findings
- Severity distribution chart — pie chart with Critical/High/Medium/Low breakdown
- Findings by category — bar chart grouping findings by domain
- Detailed findings table — severity, description, recommendation, affected artifacts
- Priority recommendations — ranked action items with estimated impact
- Clickable links — every record number, sys_property, plugin, and table name links to your instance
- Professional footer — page numbers, generation timestamp
Multi-Capability Reports
Combine multiple capabilities into a single comprehensive report. Pass a sections array instead of content:
generate_report:
format: pdf
title: "Comprehensive Instance Audit"
capability: combined-audit
sections:
- title: "Instance Health Scan"
capability: scan-health
content: <scan-health markdown>
- title: "Security Posture Audit"
capability: scan-security
content: <scan-security markdown>
- title: "Code Review Analysis"
capability: review-code
content: <review-code markdown>
# Pick any combination of capabilities — 1, 3, or all 26.
# Each section becomes a chapter in the final document.
Sample Reports
Download sample PDFs generated from a demo instance to see the output quality:
Common Use Cases
Incident Trend by Priority (Last 6 Months)
trend_query:
table: incident
date_field: opened_at
group_by: priority
periods: 6
# Returns monthly counts grouped by priority level.
SLA Compliance Rate
run_aggregate_query:
table: task_sla
group_by: has_breached
aggregate: COUNT
# Returns count of breached vs. compliant SLAs.
Top Teams by Open Incidents
run_aggregate_query:
table: incident
group_by: assignment_group
query: state!=6
aggregate: COUNT
Performance Analytics Widget
get_performance_analytics:
widget_sys_id: <PA widget sys_id>
time_range: last_30_days
# Uses the ServiceNow Performance Analytics API:
# GET /api/now/pa/widget/{sys_id}
Scheduled Job Workflows
Create and Schedule a Script
# 1. Create a new daily script job
create_scheduled_job
name="Nightly Cleanup"
script="gs.info('running');"
run_type="daily"
run_time="02:00:00"
# 2. Verify the job was created
get_scheduled_job sys_id="<sys_id>"
# 3. Trigger immediately to test
trigger_scheduled_job sys_id="<sys_id>"
# 4. Check execution history
list_job_run_history job_sys_id="<sys_id>"
Update a Scheduled Job
# 1. List all active scheduled jobs
list_scheduled_jobs active=true
# 2. Update the script or schedule
update_scheduled_job sys_id="<sys_id>"
fields={script: "// updated script", run_type: "weekly"}
Latest Reporting APIs
| API | Endpoint | Notes |
|---|---|---|
| Stats (Aggregate) | GET /api/now/stats/{table} | GROUP BY, SUM, COUNT, AVG |
| Performance Analytics | GET /api/now/pa/widget/{sys_id} | PA scorecard data |
| Reporting | GET /api/now/reporting | Saved report search (latest release) |
| Table (for sys_report) | GET /api/now/table/sys_report | Report definitions |



