Akash4
Kilo Sage

Hello,

Here is a modified script which might work:

Try this BR as Before Insert/Update on Case Task. If this Case is of HR Case then the table is sn_hr_core_case and its child is sn_hr_core_task and if its from Customer Case it has different name. Use the right one for your scenario.


if (current.parent) {
var grCase = new GlideRecord('case'); //case can be sn_hr_core_case
if (grCase.get(current.parent)) {
new GlideSysAttachment().copy('case', grCase.sys_id, 'case_task', current.sys_id); //here as well replace 'case' and 'case_task'
}
}

 

Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.