- 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-16-2025 05:41 AM
1st copy that file to case record, then use GlideSysAttachment to copy file to approval record so that the file is sent over via email.
1st part I already shared, 2nd part you can use via the OOB attachment copy feature
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-16-2025 06:59 PM
when I'm adding attachment , it is getting save as table "ZZ_YYsys_email" and "sys_email" and not as table "sn_customerservice_north_america_procurement"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 09:01 PM
It sounds like the issue might be related to how the attachments are being processed or referenced in your notification. Here are a few things you can check:
Attachment Variables Usage: Double-check that the "attachment" type variables are correctly configured and linked to the case record. Sometimes, attachments linked to variables don't automatically associate with the main record.
Notification Configuration: Ensure that the notification is set to reference the correct record where the attachments are stored. If the notification is tied to a different record, it won't pick up the attachments.
"Include Attachments" Setting: Since you've already checked the "Include Attachments" option, verify that the attachments are associated with the correct table and that they exist in the sys_email record related to the notification.
Email Log Debugging: Check the email logs to see if there are any errors or warnings. If the attachments aren't being included, the logs might provide a hint.
Access Permissions: Ensure the user generating the notification has the correct permissions to access and send the attachments. Sometimes attachments don't appear due to ACL or security constraints.
Try Manual Attachment: As a test, manually attach a file to the case (not through the variable) and see if it gets included in the email. This will help determine if the issue is with the attachment variable or the email configuration itself.
Let me know if these suggestions help or if you need further assistance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 09:05 PM
getting this error:
Write operation against 'sys_attachment' from scope 'sn_customerservice' has been refused due to the table's cross-scope access policy
Also I'm not able to create record in "sys_restricted_caller_access" table. it is saying you need "maint" role to create
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2025 10:18 PM
you need to create cross scope for this and not restricted caller access
Why the table shows sys_email?
Your requirement is about record producer
you should be in Customer Service scope and then create
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