Demo Incident Data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 11:32 PM
Hi all ,
I wanted to try task intelligence for ITSM in my PDI but the required number of incidents needed are 10k.
so is there any way I can create or get some demo incidents data.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 11:37 PM
Yes You can, Sample code to bulk create data.
Run this in background script in your PDI.
for(var i=0;i<1000;i++) //change the number accordingly.
{
var grIncident = new GlideRecord('incident');
grIncident.initialize();
//map the values accordingly.
grIncident.setValue('opened_at','');
grIncident.setValue('category','');
grIncident.setValue('caller_id','');
grIncident.setValue('priority','');
grIncident.setValue('description','incident '+i);
grIncident.insert();
}
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 11:42 PM
Hi Akshay,
You can create incident from background script by applying for loop .
something like this,
for(var i = 0; i < n ; i++){ //n number of incidents you want to create
}
Please mark this as correct/helpful if this helps you.
Thanks,
Akshay