Pass user and manager name via gs.eventQueue

Nikita Ms
Tera Contributor

We have a requirement to sent email to requester's manager for certain tasks.

We have created a scheduled job for this.

How we can pass user name, manager name,  manager email address via scheduled job using gs.eventQueue() to the notification.

We have to send notification to requeter's manager and in notification we have to put requester's name and manager name.

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can pass it as one of the 2 parameters

 

gs.eventQueue('<Event Name>', <object of record like Current or Glide Object>, <Param 1>, <Param 2>);

 

 

In param one or param 2 you can pass the manager like current.caller_id.manager & in your notification you will have to check the box 'send to param 1' and 'send to param 2' in the who will receive tab

AnuragTripathi_0-1683103125590.png

 

-Anurag

View solution in original post

7 REPLIES 7

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can pass it as one of the 2 parameters

 

gs.eventQueue('<Event Name>', <object of record like Current or Glide Object>, <Param 1>, <Param 2>);

 

 

In param one or param 2 you can pass the manager like current.caller_id.manager & in your notification you will have to check the box 'send to param 1' and 'send to param 2' in the who will receive tab

AnuragTripathi_0-1683103125590.png

 

-Anurag

Hi Anurag,

Thanks for your response. I have tried following syntax

gs.eventQueue("user_manager_notification",gr,gr.u_caller_id,gr.u_caller_id.manager);

on trying this as background script it is giving me undefined for both gr.u_caller_id and gr.u_caller_id.manager.

Are you sure if you have the right field name? u_caller_id

Double check the field na,e and print the gr.u_caller_id & gr.u_caller_id.manager in your background script, once you get this value your emails will also work.

 

since u_caller_id is a custom field i hope it is a reference to user table.

The oob field on incident is caller_id hope you didn't add u_ by mistake.

 

 

-Anurag

Thank you Anurag.

This syntax is working fine now

gs.eventQueue("user_manager_notification",gr,gr.u_client_id.manager.getDisplayValue(),gr.u_client_id.manager.email);

It is giving me manager name and manager email address.

Can you help me how to put requester's name and manager's name in the notification body.