- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018 11:05 AM
We previously used the business rule below to hide internal attachments on incidents from end users (ESS users). However, it is also blocking those users from viewing images in KB articles, which makes sense due to those images being embedded attachments from the sys_attachment table. I've tried numerous iterations of adding "Table name" filters to the "When to run" tab, and trying various forms of adding the table name condition to the script. None of these have worked.
Can anyone help me to update the BR to apply only to the incidents table when viewing attachments?
**Note: there are currently no filters set on the When to run tab, and the attachments are hidden from ESS users everywhere, unless they added the attachment.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 04:25 PM
I was finally able to get this working through some input from my new counterpart, thanks Derek Young! Below is the approach that works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 07:16 AM
Before Query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 07:24 AM
bricast,
rexked is exactly right. The 'When to run' is set to a before condition with query checkbox selected.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 07:36 AM
As soon as I add && (gr.getTableName() != 'kb_knowledge') to the condition this no longer works for Service Portal. Any idea on how I can make this work in service portal without the users loosing access to attachments that are in knowledge bases.