suresh1995
Tera Contributor

Thank you for your reply , but still not working

Task : when i upload any attachment in sc_request form ,it should also been seen in sc_task form . i tried below script but its not working ,kindly guide me

After business rule & condition: table name -is- sc_task

script:

(function executeRule(current, previous /*null when async*/) {

var taskRec = new GlideRecord(current.table_name.toString());
taskRec.addQuery("sys_id", current.table_sys_id.toString());
taskRec.query();

if(taskRec.next()){
GlideSysAttachment.copy(current.table_name.toString(), current.table_sys_id.toString(), "sc_task", taskRec.request.toString());
}
})(current, previous);