Email notifications are triggering twice.

niveditakumari
Mega Sage

Hello,

I had a requirement to send SLA breach notification for incident. I am achieving it via notification. I have created one notification with condition is sla breached changes to true but i can see in logs same email is sent twice at a time.

Can anyone please help me with this.

 

Regards,

Nivedita

1 ACCEPTED SOLUTION

Josh Virelli
Tera Guru

Hi Nivedita,

You definitely had it correct the first time with the "changes to" true instead of "is" true. We only want this notification to run on the update that changes it to true, not every time it is updated when the condition is true. That would give you more duplicate notifications than you already had LOL!

In your email logs, can you confirm it is the same Notification both times? Maybe you have two different notifications going out? Also check the Event Queue history to see if the event is being triggered twice, that may help you find the answer.

Something else to consider, look at the history of the SLA record to see if that Has Breached field is being changed multiple times from true to false and back to true. Maybe it's an issue in whatever Workflow/Flow Designer/Business Rule is setting that field.

We need to track down what the causation for the duplicates is, as I believe your notification is correct. Let me know what you find, or if you need further guidance.

If my answer was helpful or answered your question, please mark it as 'Helpful' or 'Correct'

Thanks!

Josh 

View solution in original post

21 REPLIES 21

Hello Abhishek,

I have changed When to Run Condition as Has Breached IS True. Could you please suggest me that what i need to do the changes for business rule if earlier notification doesn't work.

 

Regards,

Nivedita

 

Hello Nivedita,

1.You need to remove current.update() from BEFORE Business rules.

2. You need to remove current.update() from AFTER Business rules. Or you can add below statement:

    currenr.setWorkflow(false);  

   current.update() ;

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Hello Nivedita,

Sorry for confusion, Josh is correct!!! You need to set condition Has Breached Changes To True. On which table the notifications are available?

1). check that in workflow anywhere did you write code something like current.update() ?,   this also might cause it to trigger emails second time when it is updating the record.

 

2). In any Business rule related that table contains current.update(), then what I suggest you it either you change the code or change the ORDER number of that business rule, so that will not run immediately.

Thanks,

Abhishek

 

Thank you,
Abhishek Gardade

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Nivedita,

so you are triggering notification when sla breached is true and task assignment group is one of those 5 values

Did you check in email logs what is the time difference of the email triggered?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Abhishek,

Yes, you are correct. Now I am triggering notification when sla breached is true and task assignment group is one of those 4 values.

I have checked in email logs there is no any time difference of email got triggered.

Both emails got triggered at same time.

 

Regards,

Nivedita