how can we capture notification is worknotes

Arun61
Tera Contributor

@Jyoti36 

How can we capture email notification in worknotes

we have strike field in incident form when evert the strike changes notification will send the user the same notification should get captured in worknotes how we can achieve this.

we have send/receive email activity stream but as per the requirment we aslo need to capture the same mail in worknotes

can you please help with the script

 

3 REPLIES 3

Community Alums
Not applicable

Hi @Arun61 ,

One issue can be the outbound of the instance may be inactive.

Navigate to email logs and look for your email. The type of your notification should be "sent' to have the emails visible in activity stream.

Similar discussion is going on this thread : https://www.servicenow.com/community/it-service-management-forum/how-to-capture-notification-in-work...

 

Hello Sandeep,

Thank you for your replay

Activity stream is working fine my requirement is like we have to capture the same email with body in worknotes as well could you please help me on this.

Arun61_1-1666249690204.png

 

 

Hi Arun,

 

You may achieve this requirement by two ways mentioned below

1. Create an Async BR on sys_email table adding filter as your target table and type as Sent/receive

Try copying below codes:

(function executeRule(current, previous /*null when async*/) {

	var rec = new GlideRecord(current.target_table);
	rec.addQuery('sys_id',current.instance.toString());
	rec.query();

	if (rec.next())
	{
		rec.work_notes = 'Sent By:'+current.sys_created_by+'[code]'+current.body+'[/code]';
		rec.update();
	}
})(current, previous);

 

2. Create an inbound email action or inbound email flow (flow designer) using appropriate conditions so only your emails can be filtered and utilized. Then you can easily achieve this copying "email.body" to your current element i.e. work notes or comments.

 

Please mark reply as Helpful/Correct. Thanks!