Are there variables or other methods available in scripting that allow me to determine how many notifications are going to be sent for an incident and compare that number to how many notifications have been delivered?
You can use scripting to compare the number of Users that are scheduled to receive notifications with the number of Users that have already received them.
Note: To use these instructions, you must have the @notification::setHandleDeliveryEvents method enabled in the initial Process script.
In the initial script after,
@alert::link($event.RECIPIENTS), add the following line:
$main.personList = @event::getUniquePersons($event.RECIPIENTS)
This returns the list of Users that will receive notifications.
In the response script, add the following code:
IF ($response.response_event == "SUCCESSFUL_DELIVERY") $successtarget = $response.person_target $successindex = $main.personList::indexOf($successtarget) IF ($successindex != -1) $alreadyAdded = $main.personSentList::indexOf($successtarget) IF ($alreadyAdded == -1) $main.personSentList::add($successtarget) ENDIF ENDIF ENDIF $total = $main.personList::size() $success = $main.personSentList::size() IF ($success == $total) @script::log("Notifications Complete") ENDIF
When a notification is successfully delivered, it is added to the $main.personSentList. If$main.personList is the samesize as the $main.personSentList, then all notifications have been delivered.
JDN-1082 Originally created by Don Clark