How to duplicate a HR case including activity log?

Badrul_A
ServiceNow Employee

Just wondering if anyone has a UI script to hand for duplicating a HR case including activity log?

3 REPLIES 3

Sohail Khilji
Kilo Patron

why so? whats the need of duplicate case.?

Just want to have some dummy data for test purposes and I'm new to SN scripts. 
Created this but yet to test:

var gr = new GlideRecord('sn_hr_core_case');
gr.initialize();
gr.short_description = current.short_description;
gr.assignment_group = current.assignment_group;
gr.work_notes = current.work_notes.getJournalEntry(-1);
gr.insert();

 

 

instead of 

gr.work_notes = current.work_notes.getJournalEntry(-1);

 

You need to gliderecord the sys_journal table and copy the records.