Notification firing multiple times
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2013 03:30 AM
The business rule Abandon and Restart Notifications script is defined as:
if ( current.state == '3' && current.u_state_reason == 'cancelled' && current.approval == 'cancelled')
{
gs.eventQueue("change.abandon", current, current.requested_by);
}
The above snippet is set to fire an event for the notification to the requester and the assigned to person if the Change Activity has been Abandon.
The main issue here is that the notification is firing multiple times, Is this a bug in Service Now?
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2013 12:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2013 01:00 PM
It looks like your business rule is being executed twice.
To confirm: Please add the following debug statement so that your business rule looks like this:
gs.log('=============== TEST - Change Request ' + current.number + ' has been updated. ============');
if (current.state == '3' && current.u_state_reason == 'cancelled' + current.approval == 'cancelled') {
gs.eventQueue('change.abandon', current, current.requested_by);
}
Then examine your system log after you cancel the ticket. If you see the debug output twice, then you know something else is up.
You may have to study any other business rules on change_request. Especially be on the lookout for a call to current.update() inside a before update business rule.
Please let me know what happens. gcox@verisign.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2013 03:21 AM
Okay the problem has now been fixed by doing modifications in business rule. The modified business rule is as below:
if ( current.state.changesTo('3') && current.u_state_reason == 'cancelled' && current.approval == 'cancelled')
{
gs.eventQueue("change.abandon", current);
}