Why event is triggering multiple time through workflow run script? Email logs received many time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 01:24 AM
Hi,
I'm firing the event for a notification with below code but when I'm checking the email logs then I can seethe email logs generated many time for same notification. Is my code firing the event may time?
Can someone check please?
Workflow Run Script -
var approvers = [];
var getApprovers = new GlideRecord('sysapproval_approver');
getApprovers.addQuery('state', 'requested');
getApprovers.addQuery('group', current.task);
getApprovers.query();
while (getApprovers.next())
{
approvers.push(getApprovers.getValue('approver'));
}
gs.eventQueue('event,name', getApprovers, approvers, getApprovers.group.assignment_group_manager);
Notiication -
When to send - Event is fired
Who will receive - Send to Parm1
Please tell me why it's sending notification multiple time or event is firing multiple time?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 01:27 AM
Hi @Anmol12
I think it is because there might be more than 1 approver to a record and the notification is being triggered to all the approvers and thats why you are seeing the log many a times.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 01:30 AM
Hi Basheer,
Yes there are more than one approver but what should I do to avoid this? I want to send only one notification to all recipients under Parm1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 12:56 PM
How is the notification configured? Does it have a link to the approval record? If it does you don't want to send the same email to every approver...the link will only work for one approver. You'll be better off using User/Groups in fields on your notification and sending for each approval record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 01:31 AM
Hi @Anmol12
The reason it's showing multiple logs the one is you are sending notification to multiple recipients.
Navigate to
System Logs> Emails
check if the recipients are similar or unique.
Please mark the suggestion as helpful, if you find it useful to you or others who wants to refer similar content.
Please mark the solution as correct, if the answer provided has resolved your query.