Skip to content

Commit f17c677

Browse files
authored
Create Readme.md
This script demonstrates how to create an incident record in ServiceNow using the GlideRecord API. It is intended for use in server-side scripting environments such as Script Includes, Business Rules, or background scripts.
1 parent 5f4bd9c commit f17c677

File tree

1 file changed

+22
-0
lines changed
  • Server-Side Components/Background Scripts/Incident creation

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ServiceNow Incident Creation Script
2+
3+
## 📌 Overview
4+
This script demonstrates how to create an incident record in ServiceNow using the GlideRecord API. It is intended for use in server-side scripting environments such as Script Includes, Business Rules, or background scripts.
5+
6+
## ✅ Prerequisites
7+
- Access to a ServiceNow instance with appropriate permissions.
8+
- Familiarity with JavaScript and ServiceNow scripting.
9+
- The `incident` table must be accessible and modifiable.
10+
- Script should be executed in a server-side context.
11+
12+
## 🛠️ Script Usage
13+
14+
15+
var incident = new GlideRecord('incident');
16+
incident.initialize();
17+
incident.short_description = 'Sample Incident Created via Script';
18+
incident.description = 'This incident was created using a GlideRecord script.';
19+
incident.caller_id = gs.getUserID(); // Sets the current user as the caller
20+
incident.priority = 3; // Medium priority
21+
incident.category = 'inquiry'; // Example category
22+
incident.insert();

0 commit comments

Comments
 (0)