Employees in watch list are not able to see the requests for which they are marked in watch list

rajasekharteja
Tera Guru

Hi Team,

 

I have a requirement that Employees in watch list are not able to see the requests for which they are marked in watch list under my requests of self-service portal and also send email to watch list users

 

I have tried creating after business rule on sc_req_item table

 

(function executeRule(current, previous /*null when async*/ ) {

// Add your code here
var users = current.variables.watch_list;
gs.addInfoMessage('wl users ' + users);
if (users) {
gs.addInfoMessage(' users ' + users);
var requestGR = new GlideRecord('sc_request');
if (requestGR.get(current.request)) {
requestGR.watch_list = users;
requestGR.update();
gs.addInfoMessage('watch list ' + requestGR.watch_list);
}
}

})(current, previous);

Watch list field is not present on the request table so i have created on sc_req_item table.

 

Please check and help to achieve this scenario.

 

Thanks,

Raja