- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 07:53 PM
Hi ,
Trigger email notification when an attachment is added to an incident working fine but unable send with this body
1. Attachment by: Person that attached.
2. Attachment Date: [Date/Time]
3. You can view the attachment by clicking the link below.
4. *[link should take them to the incident.]
Event and email Notification created on incident table
Business rule created on Attachment table
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 08:26 PM
Hi there,
Can you share what you've setup and is not working fine?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2024 08:28 PM - edited 02-04-2024 08:29 PM
Hello @Purushotham1992 ,
Kindly use below script in your after insert business rule;
var rec = new GlideRecord('sys_attachment');
rec.addQuery('table_name','incident');
rec.orderByDesc('sys_created_on');
if(rec.next())
{
var user = rec.sys_created_by;
var creator = new GlideRecord('sys_user');
creator.get('user_name',user)
var attachedby = creator.getValue('name');
var createdtime = rec.sys_created_on;
}
gs.eventQueue(event name, current,attachedby ,createdtime )
In the notification, Update the body
1. Attachment by: ${event.parm1}.
2. Attachment Date: ${event.parm2}
3. You can view the attachment by clicking the link below.
4. *[link should take them to the incident.]
Please click on "Helpful" and "Accept solution" if it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 01:52 AM
Hai @siva krishna M2
Here we are using one of the parameter for group , how can we use more than two parm at a time and below two
3. You can view the attachment by clicking the link below.
4. *[link should take them to the incident.]
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 03:29 AM
Hello Purshotham,
In the notification , we can use below script to get two variables from one variable;
var t = ${event.parm2};
var k = t.split(",");
1. Attachment by: k[1]
2. Attachment Date: k[0];