Demo Incident Data

Akshay Jugran
Tera Expert

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, 

2 REPLIES 2

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Akshay Jugran 

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

Akshay37
Mega Guru

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

var inc = new GlideRecord('incident');
inc.initialize();
inc.field_name = //demodata;
inc.insert();

}

 

Please mark this as correct/helpful if this helps you.

 

Thanks,

Akshay