Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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
Tera 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
5x ServiceNow MVP

Akshay37
Giga 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