Email notification via workflow

clyon
Tera Guru

I have a workflow that runs on the cmdb_ci_appl table that creates an INC. I need an email notification to be sent when the INC is created (assigned to group  or Assigned to me).  

I found that workflows created incidents don't trigger condition based email notifications.  That correct?

So I created 2 events and duplicated the current email notifications (Incident assigned to group & Incident assigned to me) and set them up to be fired by the event with an additional condition of assignment_group = Review.  

I ran my workflow and the events were created but what I realized was that the workflow is running on cmdb_ci_appl and that automatically creates the event on that table, where as I need it created on the Incident table.

What are my options to have an email notificaiton sent out when the workflow creates the Incidents?

1 ACCEPTED SOLUTION

Mwatkins
ServiceNow Employee
ServiceNow Employee

Ah ha! Thanks for that screen shot Christina. The incident is being inserted with setWorkflow(false) - line 32 of the Workflow Activity in your screenshot. That is going to cause the platform to bypass the notification engine. There are a couple options:


1) Don't use setWorkflow(false)


2) Switch your notification over to one that fires on event creation. Use a Business Rule after insert/update to trigger the event.


(see Create your own event and Create an email notification for details about how to do this)


View solution in original post

12 REPLIES 12

no problem. let us know if you need any more help.


SanjivMeher
Kilo Patron
Kilo Patron

If there are already email configured on incident, it should work by default. There could be few conditions which may be restricting to trigger the email. Please check that and look for any errors in system log.



Please mark this response as correct or helpful if it assisted you with your question.

The SN Nerd
Giga Sage
Giga Sage

I'd recommend using the Event activity, and use a notification to pick it up.



This allows you to use templates, promoting usability and giving you more control over the email content.


Also, variables don't work from notification activities within workflows.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Aditya Telideva
ServiceNow Employee
ServiceNow Employee

Somemore info :



Notification Activities - ServiceNow Wiki


Thanks,


aditya telidevara


Mwatkins
ServiceNow Employee
ServiceNow Employee

Could it be a case of "Send to Event Creator" on the Notification blocking the email because the action that triggered the workflow was done by the only recipient on the email?