0

if (current.table_name == 'incident' )
{
  AttachmentAudit();
}
 function AttachmentAudit() {
  var attachmentMsg = '';
  var gr = new GlideRecord(current.table_name);
  if (gr.get(current.table_sys_id))
  {
  if (current.operation() == 'delete') {
  attachmentMsg = 'Attachment deleted: '+current.file_name+' by ' +current.sys_created_by+' on '+gs.nowDateTime();
  }
  else {
  attachmentMsg = 'Attachment added: '+current.file_name+' by ' +current.sys_created_by;
  }
  gr.work_notes = attachmentMsg;
  gr.update();
  }
}

Is it possible to track in the activity log when an attachment is attached or removed?
Working Code Asked question December 16, 2023