hide row in a table list

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 11:31 AM
We are working on making it so that all users can see the application in the CMDB in a List just like if you went to configuration > Applications for ITIL users. I have been asked if there is a way to hide an application from the list view if IT Owner (one of the fields) is empty. Does anybody know if this is possible and how I could go about doing it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 12:23 PM
We want to hide it from Non-IT users unfortunately we have several groups in ServiceNow that have ITIL users in them but are not IT. So hiding it from unless the group user has ITIL will not work for us. Any thoughts on how to hide in this case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 12:36 PM
do you have a way to distinguish non-IT groups/users in SN?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 05:32 AM
We do not. I guess I can create a new role and add it to these groups to identify them. Something like non-it_itil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 05:44 AM
for what you are trying to accomplish, this would make it possible. Good Luck!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2017 12:01 PM
Got a response from my HI ticket. It seems if you have the admin role gs.hasRole will return true for all roles. So I added first a check to see if the user does not have admin. I got some new requirement that says I should remove any app where there is no IT Owner, Business Owner, or it is an IT App. I setup and true/false filed called IT App that will be set to true. So I'm trying to do an add or condition but it does not see to be working. Is there something I'm doing wrong?
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (gs.getSession().isInteractive()){
if (!gs.hasRole('admin')){
if (gs.hasRole('non-it_itil') || !gs.hasRole('itil')){ //hide apps that have no it owner for ITIL user not in IT
//gs.log('non-it if');
var app = current.addQuery('u_it_owner', '!=', '');
app.addOrCondition('u_business_owner', '!=', '');
app.addOrCondition('u_it_app', '!=', true);
}
}
}
})(current, previous);