Send case notification when opened by is different to the contact

Luke James
Tera Contributor

Hi All, 

 

I have a requirement on a case to send an a notification when the case is opened and the contact on the notification is different to the opened by. 

 

I've tried building this in the condition builder, but it won't let me do this. Does anyone know how I can meet this requirement? 

 

Kind Regards, 

 

Luke

9 REPLIES 9

@Sid_Takali Thanks very much. I need to also check if the contact has the role sn_customerservice.customer. Could that also be written in the advanced condition?

Hi @Luke James Yes, You can 

 

if ((current.contact.hasRole('sn_customerservice.customer')) && (current.contact != current.opened_by)) {
    answer = true;
} else {
    answer = false;
}

 

Please Mark my answer Correct/Helpful, If I'm able to resolve your issue,

Regards,

Siddha

Thanks very much for this @Sid_Takali. The notification does seem to still be sending though even though the contact on the case does not have the role "sn_customerservice.customer'? 

 

Any thoughts? 

 

Kind Regards, 

 

Luke

Hi @Luke James Try this code 

var Contact = gs.getUser().getUserByID(current.getValue('contact')).hasRole('sn_customerservice.customer');
if ((Contact) && (current.contact != current.opened_by)) {
    answer = true;
} else {
    answer = false;
}

Please Mark my answer Correct/Helpful, If I'm able to resolve your issue,

Regards,

Siddha

Hi @Luke James Try this code,

var Contact = gs.getUser().getUserByID(current.getValue('contact')).hasRole('sn_customerservice.customer');
if ((Contact) && (current.contact != current.opened_by)) {
    answer = true;
} else {
    answer = false;
}

Please Mark my answer Correct/Helpful, If I'm able to resolve your issue,

Regards,

Siddha