- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 08:40 AM
Hi All,
I want to hide attachments on incident form for end users if it is added by ITIL users/ any role users,
But still end users can attach the attachments and they can manage the attachments which are attached by end users.
Thanks in advance.!!!
Thanks,
Rajashekhar Mushke
Community Leader
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2019 09:31 AM
Sample Script:
before query business rule on sys_attachment table.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (!gs.hasRole('itil') && gs.getSession().isInteractive()) {
var u = gs.getUserName();
var q = current.addQuery('sys_created_by', u);
q.addOrCondition('sys_updated_by', u);
gs.log('query restricted for user: ' + u);
}
})(current, previous);
you try something like this .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 08:46 AM
Hi, Rajashekhar,
There are ACLs on sys_attachment table you might want to look at them & try restricting attachments from there.
For more info follow the below link:
https://community.servicenow.com/community?id=community_question&sys_id=7edb4be1db9cdbc01dcaf3231f96194d
Mark it as correct or helpful if this helps.
Thanks
Veer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2019 08:47 AM
just curious to understand here, how if assignee will attach the attachment for end user? did you consider this point in your requirement? as you had mentioned end user (user without role ) can see only own attachment because it will would be some case that assignee want to send the resolution details on attachment so user can see and confirm the issue resolved or not. ( just adding my point here ).
did you try with query business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2019 09:07 AM
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2019 09:31 AM
Sample Script:
before query business rule on sys_attachment table.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (!gs.hasRole('itil') && gs.getSession().isInteractive()) {
var u = gs.getUserName();
var q = current.addQuery('sys_created_by', u);
q.addOrCondition('sys_updated_by', u);
gs.log('query restricted for user: ' + u);
}
})(current, previous);
you try something like this .