Repeated name appear in watchlist selection field

SoumyasreeP
Tera Contributor

Hi ,

While I am working on configuration of watchlist in incident form, i found my name is repeatedly coming under watchlist field.

Record producer script 

var memberIds = (producer.watch_list + '').split(',');

var userIds = [];
for (var i = 0; i < memberIds.length; i++) {
var id = memberIds[i].trim();
if (!id) continue;
var gr = new GlideRecord('sys_user_grmember');
if (gr.get(id)) {
userIds.push(gr.user);
}

}
current.watch_list=userIds.join(',');
current.u_watch_list = userIds.join(',');
why its not working?
11 REPLIES 11

Ankur Bawiskar
Tera Patron

@SoumyasreeP 

did you check there are multiple users with same name?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

yes. i have uploaded the screenshot also

SoumyasreeP_0-1779367603120.png

Please check above screenshot

@SoumyasreeP 

if you don't populate the watch list using then also it shows repeated names?

OR

if you create new incident from native then also it shows repeated names?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader