Adding to Watch List

sgmartin
Kilo Guru

Got something that is driving me crazy now for a couple days.

Created a secondary List Collector in my Service Request that is pointing to a custom table for the user to select Distribution Lists to be added to the Watch List.  I'm using Chuck Tomasi's script include ListUtil and it appears to be doing exactly what it's supposed to do.  I've added numerous gs.log lines so that I can see what's going on.  I've put all this within a Business Rule (before insert) on the sc_req_item table.

 

var snSupport = 'ServiceNowSupport@mycompany.com';
var lu = new ListUtil(current.watch_list);
gs.log('Final: list=' + lu.getList());
current.watch_list = lu.getList();
In the log I see this entry:
Final: list=634092984fb293000cb076601310c767,f38c579c4f17c6000cb076601310c70f,ServiceNowSupport@mycompany.com

But when I submit the SR and look in the email log, the additional email did not get added.  

13 REPLIES 13

Yeah, I'd agree that the logs are indicating you're coming up with the correct list.  Are you sure your business rule has the correct 'When' value of 'before' and has 'insert' and/or 'update' checked?

sgmartin
Kilo Guru

Yes.  Looked that over a number of times.  At first it was just Insert but when I added Update, nothing changed.

Maybe try the same script on the incident table to test.  Just take the business rule you have and change the table...leave everything the same.  I wonder if you've got some other business rule or configuration overriding the watch list.

sgmartin
Kilo Guru

This has morphed into an even stranger issue.  Yesterday we cloned down from Prod to Dev and then upgraded our Dev environment to London.

In my Business Rule I run this:

var ag = 'c36b175c4f17c6000cb076601310c722';

current.watch_list = current.watch_list + ',' + ag;

gs.log('Full => ' + current.watch_list);

 

The log shows this:

Full => c36b175c4f17c6000cb076601310c722,f38c579c4f17c6000cb076601310c70f

 

But in the actual watch_list field, this is what's getting stored:

undefined,f38c579c4f17c6000cb076601310c70f