Adding user to watchlist

Shiva Kumar8
Kilo Guru

Hi  Community,

I'm trying to add a user to watchlist whenever an incident is created. SO I created a Business Rule(before insert) on incident table and added the below script but it is not working

(function executeRule(current, previous /*null when async*/) {

	gs.addInfoMessage("BI Group");
	current.watch_list = "usersys_Id here";

})(current, previous);

I tried to remove the toString() as well but still not working

(function executeRule(current, previous /*null when async*/) {

	gs.addInfoMessage("BI Group");
	current.watch_list = "usersys_Id here";

})(current, previous);

I can see the info message if I change the business to after insert, but  the user is still not adding to watchlist. please help

1 ACCEPTED SOLUTION

Shakeel Shaik
Giga Sage
Giga Sage

 

 

current.setValue('watch_list', 'sys_id');
Thanks,
Shakeel Shaik šŸ™‚

View solution in original post

6 REPLIES 6

Shakeel Shaik
Giga Sage
Giga Sage

 

 

current.setValue('watch_list', 'sys_id');
Thanks,
Shakeel Shaik šŸ™‚

adding sys_id dynamically or its a static sys_id ?

 

Please check and let us know

Thanks šŸ™‚

Thanks,
Shakeel Shaik šŸ™‚

I'm using static sys_id

	current.setValue('watch_list', 'effdb858db7647004e7f71198c961901');

but still not working

Hi,

It should work, make sure you have added valid user sys_id.

Also try enabling debugger and see if any other BR resetting it.

find_real_file.png

 

 Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande