Set watch list with business rule

petterbj_rgmo
Tera Contributor

Hello all,

We are on Helsinki and using inbound actions with the Service Desk Call plugin. In the inbound action I created I am adding a email address to the watch list on the Call form. When the Call type is set to request, I need the email address on the watch list to be added to the watch list on the request item. So basically I want the email address in the watch list to be added to the RITM when it is created. I have tried doing this with a business rule (after) that runs on insert and is run on the sc_req_item table. The code is as follows:

find_real_file.png

I cannot seem to figure out where I am going wrong. Any ideas?

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Here you go. Use this script. This should be a before business rule



var gr1= new GlideRecord("new_call");


gr1.addQuery("transferred_to",current.getValue("request"));


gr1.query();


if(gr1.next()){


current.watch_list=gr1.u_watch_list;


}


View solution in original post

21 REPLIES 21

Hello Abhinay.



Thank you for helping. Your script is unfortunately not working. I will add some screenshots of the business rule for reference.


find_real_file.png


find_real_file.png


Okei, so I added some logs. The code is now as follows:



find_real_file.png



I then created a Call, making it a request and ordering a request item. I checked the logs and the entry I got was as follows:


find_real_file.png



This means that the query is wrong and it does not enter the IF. But why?


Recheck the name of transferred_to field. If it is a custom field then its name should be like u_transferred_to.



Thanks,


Mihir


Actually the field is out of the box reference to the task table.



find_real_file.png


Can you check the transferred to field field contains REQ number or RITM number in this case ?



Thanks,


Mihir