diff --git a/Business Rules/Attachment Variable from Activity Stream to Clip Icon/Attachment Variable Fix.js b/Business Rules/Attachment Variable from Activity Stream to Clip Icon/Attachment Variable Fix.js new file mode 100644 index 0000000000..6903bf4a40 --- /dev/null +++ b/Business Rules/Attachment Variable from Activity Stream to Clip Icon/Attachment Variable Fix.js @@ -0,0 +1,12 @@ +//Run this Business Rule async Insert on the sc_req_item table if using the attachment type variable in a Catalog Item +(function executeRule(current, previous /*null when async*/) { + var gr = new GlideRecord("sys_attachment"); + gr.addQuery("table_name", "ZZ_YY" + current.getTableName()); + gr.addQuery("table_sys_id", current.sys_id); + gr.query(); + while (gr.next()) { + gr.table_name = current.getTableName(); + gr.update(); + + } +})(current, previous); diff --git a/Business Rules/Attachment Variable from Activity Stream to Clip Icon/readme.md b/Business Rules/Attachment Variable from Activity Stream to Clip Icon/readme.md new file mode 100644 index 0000000000..7eb21d5175 --- /dev/null +++ b/Business Rules/Attachment Variable from Activity Stream to Clip Icon/readme.md @@ -0,0 +1 @@ +When attaching a file via an attachment type variable, on the target record the attachment appears in the Activity Stream instead of at the top associated with the paper clip icon, where one typically looks for / notices attachments. This Business Rule will convert the entry in the sys_attachment table so that the attachment added via an attachment type variable appears at the top of the record, associated with the paper clip icon.