How can I get the sysID of a notification and include it inside the same notification

ServiceNowSteve
Giga Guru

I want to be able to identify which email notification sent a particular message so what I want to do is get the sysid of the notification and send it out inside of its own notification for each alert.

I tried the suggestions here: https://community.servicenow.com/community?id=community_question&sys_id=bd9470c8db139700fff8a345ca961955

but it either doesn't work or I am not understanding the execution...can anybody else think of a solution?

1 ACCEPTED SOLUTION

Shishir Srivast
Mega Sage

I believe you need to create the email script using below script and then call the email script in your email notification. try to print in logs and see what you get?

template.print('Email sys_id:  ' + email_action.getUniqueValue());
gs.log('Email sys_id:  ' + email_action.getUniqueValue());

View solution in original post

2 REPLIES 2

Shishir Srivast
Mega Sage

I believe you need to create the email script using below script and then call the email script in your email notification. try to print in logs and see what you get?

template.print('Email sys_id:  ' + email_action.getUniqueValue());
gs.log('Email sys_id:  ' + email_action.getUniqueValue());

You've done it again! You are too good Shishir! 🙂

Thank you sir.