- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
i want a servicenow use case built where - if attachment is added to RITM then email should trigger to the corresponding active sctask assigned to member, how can I achieve this using event, BR, notification step. In the notification how can i add the (dynamic scenario to send to assigned to ) . Any other suggestion is highly appreciated here.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can use flow for this with no scripting and no BR, event, notification etc
Something like this
I attached the gif as well to the comment
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi Mark,
Thanks for the "hate", but I already tried the notification part via event , BR (I failed to mention it in the question)but I was stuck in the part of notification which says who will receive and there we dont have option to add script, so the sctask "assigned to" would be a dynamic person for each RITM and so I was wondering if anyone would suggest their ideas 😞.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @amita2
Try this:
Note: It is sample steps- update it as per your requirement.
1. Create Event
Navigate to System Policy > Events > Event Registry.
Click New.
Event name: ritm.attachment.added
Table: Requested Item [sc_req_item]
Description: Triggered when an attachment is added to a RITM
2. Create Business Rule
Navigate to System Definition > Business Rules.
Click New.
Name: Notify SCTask Owner on RITM Attachment
Table: Requested Item [sc_req_item]
Advanced: Checked
When to run: After | Insert
Condition: current.hasAttachments()
(function executeRule(current, previous /*null when async*/) {
var scTaskGr = new GlideRecord('sc_task');
scTaskGr.addQuery('request_item', current.sys_id);
scTaskGr.addQuery('active', true);
scTaskGr.query();
while (scTaskGr.next()) {
if (!scTaskGr.assigned_to.nil()) {
gs.eventQueue('ritm.attachment.added', current, scTaskGr.assigned_to.toString(), scTaskGr.number);
}
}
})(current, previous);
3. Create Notification
Navigate to System Notification > Email > Notifications.
Click New.
Table: sc_task [sc_task] (since it is the active task we are targeting).
When to send: Event is fired
Event name: ritm.attachment.uploaded
Dynamic Scenario Setup (Who will receive)
Go to the Who will receive tab.
Scroll to Users/Groups in fields and select Assigned to.
Subject: New Attachment on Request: ${request_item.number}
<p>Hello ${assigned_to.name},</p>
<p>A new attachment has been uploaded to the Request Item (RITM) associated with your active task.</p>
<p><b>Attachment Name:</b> ${event.parm2}</p>
<p>Click here to view your task: <a href="${URI_REF}">${number}</a></p>
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti