Send separate notification to each approver

Bhoomi Chaudhar
Tera Contributor

Hey everyone, I am struggling to trigger notifications for each approver. For example, When case is generated,

First Approval Goes to team leader - Send Approval Notification to team leader...if TL Approves then

Second Approval goes to Manager - Send Approval Notification to Manager

Now I am trying to send notifications but it seems that

TL receives two notifications(one with TL Approval and second is with Manager Approval)

Manager receives two notifications(one with TL Approval and second is with Manager Approval)

FI: Separate 2 notifications, 2 email template are created for above

1 ACCEPTED SOLUTION

Hi @Bhoomi Chaudhar 

var gr = new GlideRecord("sysapproval_approver");
gr.addQuery("approval_for",current.getUniqueValue());
gr.query();
while(gr.next()){
//This while will give you all the approvals related to the record
//Here you need to write a script saying the approval which is yet to be approved. In your case in first it would be Team Lead and then followed by Manager when this BR triggers for the 2nd time.
}
}
Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

6 REPLIES 6

Basheer
Mega Sage

Hi @Bhoomi Chaudhar ,

If you are doing it via workflow, I hope you have configured the notification 2 times.

Instead of directly adding the user to the notification, add them via email scripts. 

 

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

Bhoomi Chaudhar
Tera Contributor

No, I am trying to fire based on event and event is called from Business rule. So my question is how can I identify Approver record(in approval table) for specific case and also make sure its not triggering two times. FI: I have created Flow for Approval process but it seems hard to send notification through it. So using events

 

Since you are already using BR to trigger events.

Glide into approver table and fetch the approval record. there you can find the manager 

in the event params send the manager id.

Let me know if you want code to find out the approval record.

 

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

@Basheer Thanks. Can you please share the record? It will be helpful