Notification

Anusha Medharam
Tera Contributor

There is one requirement came up like once the Parent case Status Changes to awaiting info, similarly Child case Status should also change as well. I should stop notification when parent case state changes to awaiting info. Again notification send to customer when only any child case state changes to awaiting info via parent case.

if (current.parent.state==18 && current.u_awaiting_info_update.changes()) {
    answer = false;
} else {
    answer = true;
}. I was using above code but its not working.
3 REPLIES 3

Maddysunil
Kilo Sage

@Anusha Medharam 

You can write after business rule and use eventQueue method to trigger the notification, Sample code below:

 

(function executeRule(current, previous /*null when async*/) {
    // Check if the current record is a child case and its parent is awaiting info
    if (current.parent && current.parent.state == '18' && current.state.changes()) {
        // If the parent case's state is "Awaiting Info" and the child case's state has changed
        // Send notification
        gs.eventQueue('child_case_awaiting_info', current, current.sys_id);
    }
})(current, previous);

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

can we use this code in advanced conditions script in notifications

 

@Anusha Medharam 

I don't think so instead you should try to write BR and trigger notification from there.

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks