How to duplicate a HR case including activity log?

Badrul_A
ServiceNow Employee
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
Kilo Patron

why so? whats the need of duplicate case.?


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

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.


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect