- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 06:48 AM
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.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 06:56 AM
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.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 06:56 AM
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.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 07:34 AM
Hi,
As mentioned by Anubhav you need to use record producer script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader