- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 04:48 AM
I have RP created for CSM table, where i have used some "attachment" type variables.
when submitting case with attachments, attached using "attachment" variables, they are not populating on top of the case. Rather they are seen in activity stream.
My issue is, I have simple notification created and "include attachment" is checked but still attachments are not getting on email. even in email log it is not attached. where can be the issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 05:05 AM
attachment from attachment variable is not automatically copied to the target record
check solution here which I shared for this and it should copy the file to target record
Disable ZZ_YY prefix from attachment when added through record producer
sharing the solution again here
1) I created Async After Insert BR on the target table
2) Script as this
a) Remove the ZZ_YY
b) Then use the Copy Attachment
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "ZZ_YY" + current.getTableName());
gr.addQuery("table_sys_id", current.sys_id);
gr.query();
if (gr.next()) {
gr.table_name = current.getTableName();
gr.update();
new global.VariableUtil().copyAttachment(gr.sys_id, current.getTableName(), current.sys_id);
}
})(current, previous);
Output:
1) The file added to the record
2) The file present on the attachment variable
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2025 07:05 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2025 06:37 PM
i have added after BR on case table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2025 08:02 PM
I have removed query " grnew.addQuery("table_name", "ZZ_YYsn_customerservice_north_america_procurement");" and updating all records again. And it is working fine