Notify requestor that attachment is attached in requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 11:46 PM - edited 09-19-2023 11:50 PM
Hi All,
I have a requirement to send notification to Requested for and watch list with attachment when attachment is added in the Requested item.
I created a mail script(to add latest attachment in the notification) and added that in the notification when additional comments changes. I asked client to add additional noted when they added attachment. but they are not agreed with this. They didn't agree with this.
Please help in this.
Thanks,
Samiksha
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 02:46 AM
something like this in BR
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", current.table_sys_id);
gr.query();
if (gr.next()) {
gs.eventQueue('event_name', gr, gr.request.requested_for);
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 03:23 AM
Hi @Ankur Bawiskar,
Why suggest creating a custom BR on sys_attachment table, when there already is an event which can and should be leveraged? (As I already posted)
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 03:31 AM
I missed the earlier part.
Yes we can use that event but since the file needs to be present in the email the Event, notification should be on RITM table
One challenge here would be that email will have all files attached on RITM and not just one which was added recently. For that we will require business rule on sys_email table which is not recommended.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 03:38 AM
@Ankur Bawiskar,
I can see your reasoning, that is exactly why I recommended the existing event, since additional BR's on sys_attachment are also not recommended. 🙂
Using the ootb event also gives access to the sys_id of the attachment, so there might be a possibilty to leverage that in a email script. However I would need to explore the possibilities there.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.