Notification from Incident Table, when all incident tasks are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 02:32 PM
My goal is to send an Notification from the Incident Table when All Incident Tasks are closed. The Notification and Event are on the Incident Table and the Business Rule is on the Incident_Task table. I also need to include all task numbers under the Incident within the notification.
I have written an Event to trigger when any Incident Task is closed. Then the Business Rule (Script below) which calls the Notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:24 PM - edited 03-07-2025 03:28 PM
Could you please share screenshots from your Notification? When to send section.
Is it Send When "Event is fired"? and your event is mapped in there correctly?
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:28 PM
Here you go, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:40 PM
Thanks a lot for your quick revert. Let's give it a try with the following approach.
- Deactivate your business rule
- Adjust the notification condition as highlighted below:
- In the Advanced Condition, please provide the following script:
answer = canNotificationBeSent();
function canNotificationBeSent(){
var count = 0;
var gr = new GlideAggregate('incident_task');
gr.addEncodedQuery("incident=" + current.incident + "^active=true")
gr.addAggregate('COUNT');
gr.query();
if (gr.next()) {
count = parseInt(gr.getAggregate('COUNT'));
}
if (count == 0) {
return true;
}
return false;
}
if it is still doesn't work, could you please log the count variable and share the results.
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 06:26 PM
Hi @Kendra F
Did it work for you?
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 09:07 AM
The notification didn't fire using this. My Notification is on the Incident Table, so wouldn't that check the Incident for changes and not the Task?