- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 08:51 PM
I have insert BR written to add attachment from sys_attachmnet table to csm table. Attachment getting added when raising from admin user, but when raising from end user/ITIL user then getting below error:-
Write operation against 'sys_attachment' from scope 'sn_customerservice' has been refused due to the table's cross-scope access policy
Already created scope policy and it is working only for admins
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 04:42 AM
this line in record producer script will do the job in both native and portal.
Working solution here, give your correct variable name
new global.VariableUtil().copyAttachment(producer.my_file,'sn_customerservice_case', current.sys_id);
Output:
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-22-2025 03:18 AM
Requirement is :
we have multiple "attachment" variable created for one record producer for CSM.
whenever any attachment is added to these "attachment" variable, all those attachment should get added to parent case as well as .
when we check the attachment table, those files are getting created with "ZZ_YYsn_customerservice_north_america_procurement" table. Hence, written BR to remove "ZZ_YY" from table_name so that the attachment will show in case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 03:47 AM
I already shared solution for something similar earlier to your other question
Attachment not getting attached in email
what extra is required in this 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-22-2025 04:03 AM
yes, that solution was working from backend. But when tried from portal it is giving below error:-
Write operation against 'sys_attachment' from scope 'sn_customerservice' has been refused due to the table's cross-scope access policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 04:17 AM
Ideally it should not impact in copying the file based on native or portal
The BR should be in Customer Service Scope
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-22-2025 04:34 AM
add this
I got the reason why it's working from native and not from portal.
For native the table name is ZZ_YYsn_customerservice_case but for portal it's ZZ_YYsc_cart_item
I doubt this will work from portal because the sysId in table_sys_id in sys_attachment is the cart sysId which we can't get.
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