hide row in a table list

Brian Lancaster
Tera Sage

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?

11 REPLIES 11

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?


do you have a way to distinguish non-IT groups/users in SN?


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.


for what you are trying to accomplish, this would make it possible. Good Luck!


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);