Add name using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 03:02 AM
Hi All,
I have a incident ('No : INC0001234') in that i need to add 'Florrie' into watchlist of that incident by using script. Can any one please help me with this requirement.
Thanks & Regards,
Umar Shaik.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 03:23 AM
Hey,
If its a one time thing, you can go to Fix Script and create a new record.
You can use below script:
var inc = new GlideRecord('incident');
inc.addEncodedQuery('sys_id=<insert sys_id of your incident>');
inc.query();
if(inc.next()){
inc.watch_list = '<insert sys_id of your user>';
inc.autoSysFields(false);
inc.setWorkflow(false);
inc.update();
}
If my answer has helped you in any way please mark it as correct or helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 04:15 AM
Hello @umar5 , I assume, you'd like to update incident upon submission/update, if so you can write a BR, which runs on insert and update, and in advanced section use below script. hopefully, it should work, if not please share your problem/use case.