Dynamic condition script - Targeted Recipient List

Kri
Tera Guru

I want to create a new Recipient list where from the Script I have to check the Product selected at Major Issue Management level and have to populate the list of customers having the same product

I want to create one Recipient list that will return all the Customers irrespective of the Selected product in MIM level

I wrote the below script, correct me where I'm going wrong?

Krishna124_0-1685097660340.png

 

8 REPLIES 8

Manmohan K
Tera Sage

Hi @Kri ,

 

Can you give the code so that i can edit it

(function(){
    var grd = new GlideRecord('sn_customerservice_case'
        grd.addEncodedQuery('major_case_state=accepted');
        grd.query();
        if(grd.next()){
            return grd.product.ref_sn_prd_invt_product_inventory.contact;
        }
    })();

@Kri ,

 

Try with below code with the same steps as described in earlier thread

 

(function(){

var list=[];
    var grd = new GlideRecord('sn_customerservice_case') 
        grd.addEncodedQuery('major_case_state=accepted');
        grd.query();
        while(grd.next()){
             list.push(grd.product.ref_sn_prd_invt_product_inventory.contact);
        }
 var obj = {'internal' :  list}; 
    return obj; 
   
    })();

 

I'm not seeing any contact coming as a output here, may I know why?