Add current logged user to notification/email template

ceraulo
Mega Guru

Hello!

Is it possible to add to an email body the currently logged user's name and location?

For example,

 

Dear caller.first name,

Incident Number: xxxx
Short Description: xxxx
Priority: xxxx

Thank you.

Currently logged user's name
Currently logged user's location

 

Thanks!

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Naveen makes a good point. Notifications can be triggered from different locations including Flow Designer, Workflow, Scheduled jobs, triggered from events or directly from record updates/inserts.

A universal approach would require you to evaluate all possible scenarios and ensure they are compliant so your notification script has at least the sys_id of the user who triggered the message. 

Example, if they are triggered by an event, you can include gs.eventQueue() and use the third or fourth argument to pass gs.getUserID(). However you may to be in control of all the events triggered.

View solution in original post

6 REPLIES 6

I've figured out the notification trigger part by using the appsec.admin.export event. I'm stuck on how to populate the logged in user details in the email

Andrew Barnes -
ServiceNow Employee
ServiceNow Employee
Greetings ceraulo,
 You can achieve this on a case by case basis, by adjusting the notification and its trigger or by inserting it automatically into the comment field with a business rule. Typically this can have unwanted side effects, and should instead be part of the Agents process when sending the note. You can achieve this by giving the agent a button next to the comment box, to insert a signature - which could contain that information.

-Andrew Barnes

Join me at Developer Blog