Update watch list on incident

Kumar147
Tera Contributor

Hi all,

There is record producer which extends to Incident, when the watch list field on record producer is empty two default user should be added in incident, if we add any user in watch list field during creation that user along with the two default users should add. i am trying with below script which are duplicating the users. please help me out of this thing.

find_real_file.png

1 ACCEPTED SOLUTION

AnubhavRitolia
Mega Sage
Mega Sage

Hi Phani,

Instead of BR, try writing Script on Record Producer script as below:

var user1 = Sys_id1;

var user2 = Sys_id2;

if(gs.nil(producer.watch_list)) {

current.watch_list = user1+','+user2;

} else

current.watch_list = user1+','+user2+ ','+producer.watch_list;

}

Please mark this as correct answer if it resolved, or mark this helpful if this help you to reach towards solution.

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

View solution in original post

2 REPLIES 2

AnubhavRitolia
Mega Sage
Mega Sage

Hi Phani,

Instead of BR, try writing Script on Record Producer script as below:

var user1 = Sys_id1;

var user2 = Sys_id2;

if(gs.nil(producer.watch_list)) {

current.watch_list = user1+','+user2;

} else

current.watch_list = user1+','+user2+ ','+producer.watch_list;

}

Please mark this as correct answer if it resolved, or mark this helpful if this help you to reach towards solution.

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

As mentioned by Anubhav you need to use record producer script

Regards
Ankur

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