Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.addQuery('priority', 1); // P1
gr.query();

var count = 0;
while (gr.next()) {
gs.info('Active P1 Incident: ' + gr.number + ' | Short Description: ' + gr.short_description);
count++;
}

gs.info('Total Active P1 Incidents Found: ' + count);
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Fetch Active P1 Incidents – ServiceNow Background Script

This script retrieves all **active incidents** with **Priority 1 (P1)** from the ServiceNow `incident` table. It is useful for monitoring critical issues that are still unresolved.

## 🧩 Purpose

To identify and list all high-priority incidents that are currently active, enabling quick review and escalation if needed.

## 🛠️ Script Details

- **Table**: `incident`
- **Filters Applied**:
- `active = true`
- `priority = 1` (P1)

## ▶️ How to Use

1. Navigate to **System Definition > Scripts - Background**
2. Paste the script into the editor
3. Click **Run Script**

## 🧪 Example Output
Loading