How to Check if an attachment has been added by agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 04:43 AM
Hi All,
I have a requirement to check "If an attachment has been added by an agent(Assigned To) user to a case " if yes then trigger the notification.
Can someone help with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 05:53 AM
To send a notification when the Assigned To user adds an attachment to a Case.
- Created a Business Rule on the sys_attachment table.
It checks if the attachment is for a Case and added by the Assigned To user. - If yes, it triggers a custom event.
- Then I created a notification for that event.
- Notification is sent only when the Assigned To user adds the attachment.
if (cGR.assigned_to == current.sys_created_by) {
gs.eventQueue('case.attachment.by.agent', cGR, cGR.sys_id, cGR.assigned_to);
}
If my response helped, please mark it correct.
Regards,
Syed K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2025 02:59 AM
Hi @Syed zabiullah .,
Sorry the email needs to be triggered only if attachment is not added by Assigned to user.
I have configured the below script to trigger notification once an attachment is added.
In this i have to check if attachment is added by assigned to user, if yes then notification should not be triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 06:04 AM
Hi @sanvi
You can do this by creating a Business Rule on sys_attachment.
Advanced: checked
When to Run: After, Insert.
Condition: Table name is "your case table"
Script:
var caseGR = new GlideRecord('your_case_table');
if (!caseGR.get(current.table_sys_id)) {
return;
}
if (!caseGR.assigned_to) {
return;
}
if (caseGR.assigned_to.user_name.toString() == current.sys_created_by.toString()) {
gs.info('Condition True');
//Fire event/notification gs.eventQueue
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2025 02:56 AM
Hi @Muhammad Salar ,
I have configured the below script to trigger notification once an attachment is added.
In this i have to check if attachment is added by assigned to user, if yes then notification should not be triggered.