ACL to allow a watchlist user to view a RITM. These are non ITIL users

Nitesh Balusu
Giga Guru

Hello,

 

Can someone tell me the script to put in the ACL to allow a watchlist user to view a RITM. These are non ITIL users, I am able to allow to view the RITM normally but i need to add the condition that they are part of the watchlist for them to view it.

 

Thanks.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Sree,

 

Try using below script in for read ACL on respective table

 

var u = gs.getUserID();
answer = current.caller == u || current.opened_for == u || current.opened_by == u || current.watch_list.toString().indexOf(u) >=0;
//checks for Caller, opened for, opened by, watchlist to be same as logged in user if so allow the read access

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

 

View solution in original post

3 REPLIES 3

Sai Anna
ServiceNow Employee
ServiceNow Employee

you can use the following line in the script section 

 

current.watch_list.indexOf(gs.getUserID()) > -1;

 

 

 

 

 

 

Thanks,

Sai

Hit like, Helpful or Correct depending on the impact of the response

Jaspal Singh
Mega Patron
Mega Patron

Hi Sree,

 

Try using below script in for read ACL on respective table

 

var u = gs.getUserID();
answer = current.caller == u || current.opened_for == u || current.opened_by == u || current.watch_list.toString().indexOf(u) >=0;
//checks for Caller, opened for, opened by, watchlist to be same as logged in user if so allow the read access

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

 

Nitesh Balusu
Giga Guru

Thanks a lot!