Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

 

1 REPLY 1

Abbas_5
Tera Sage
Tera Sage

Hello @rajasekharteja,

 

For similar kind of issue, please refer to the below link:
https://www.servicenow.com/community/hrsd-forum/how-the-watchlist-person-can-able-to-see-my-requests...

 

If it is helpful, please mark it as helpful and accept the correct solution by refer to this solution it will helpful to them.

 

Thanks & Regards,

Abbas Shaik