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,15 @@
(function() {
var incidentGR = new GlideRecord('incident');
incidentGR.initialize();
incidentGR.short_description = 'Critical system outage';
incidentGR.description = 'All users are unable to access the core application. Immediate attention required.';
incidentGR.impact = 1; // High
incidentGR.urgency = 1; // High
incidentGR.priority = 1; // P1
incidentGR.category = 'network'; // Example category
incidentGR.assignment_group = 'NETWORK_SUPPORT'; // Replace with actual group sys_id or name
incidentGR.caller_id = gs.getUserID(); // Current user
incidentGR.insert();

gs.info('P1 Incident created: ' + incidentGR.number);
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Create P1 Incident – ServiceNow Script

This script automates the creation of a **Priority 1 (P1)** Incident in ServiceNow. It is useful for testing, automation, or simulating critical incident scenarios.

## 🧩 Purpose

To quickly generate a high-priority incident record with predefined values for urgency, impact, and description.

## 🛠️ Script Details

- **Table**: `incident`
- **Priority**: 1 (High Impact + High Urgency)
- **Fields Set**:
- `short_description`: "Critical system outage"
- `description`: Detailed explanation of the issue
- `impact`: 1 (High)
- `urgency`: 1 (High)
- `priority`: 1 (Calculated)
- `assignment_group`: Example group (`NETWORK_SUPPORT`)
- `caller_id`: Current logged-in user

## ▶️ How to Use

### Option 1: Background Script

1. Navigate to **System Definition > Scripts - Background**
2. Paste the script
3. Run it

### Option 2: Script Include

Wrap the logic in a Script Include and call it from a Flow, Business Rule, or UI Action.

## 🧪 Example Output

Loading