logo

NJP

Copy Attachment from one table to another | Attachment from Incident to Problem

Import · Aug 05, 2022 · article

I have explained how to Copy Attachments from one table to another using Business Rules.

If you have any feedback related to the scripting part, please write it in the comment box.

==================BUSINESS RULES====================

Table - Requested ItemWhen to Run - Before UpdateCondition - Send Attachments to TrueScripts -

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

// Add your code here var copy = new GlideRecord('problem'); copy.addQuery('parent', current.getUniqueValue()); copy.query(); if (copy.next()) { GlideSysAttachment.copy('incident', current.getUniqueValue(), 'problem', copy.getUniqueValue()); }

})(current, previous);

Best Regards,

Prashant

If my article helped you in any way, please mark this as helpful and make this a bookmark.

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/copy-attachment-from-one-table-to-another-attachment-from/ta-p/2317939