Issue firing Events/Notifications based on the Task table from Workflow/Business Rule

Lavanya D
Kilo Contributor

Hi all,

I have a requirement to send a OOB Task level Notification for an external (user outside of servicenow) email id, I have created a branch activity and kept catalog task as well as Run script in workflow to handle in parallel , so first as soon as task gets created the run script to call the event  "sc_task.assigned.to.group" and sends notification to "abc@gmail.com".

 But only the event log is created, email is not sent for the above. I even tried to trigger event by creating "Create Event" in workflow but this is also just creating a event log , email is not sent.

So I tried the same even with Business rule, but still only the event log is created email is not sent or ignored. 

 

Note: I checked even the event parameters in the corresponding notification and tried, then too not working.

 

Any assistance would be greatly appreciated.

Thanks

Lavanya

17 REPLIES 17

Hi Lavanya,

Is the event processed successfully?

How are you setting the recipient ? I could see you are using tsk.sys_id for parameter 1

you need to send recipient here; abc@gmail.com as event parm1

gs.eventQueue('sc_task.assigned.to.group', tsk,'abc@gmail.com');

Also ensure this checkbox is true on notification under Who will receive tab

Event parm 1 contains recipient > true

find_real_file.png

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,

I tried this also gs.eventQueue("sc_task.assigned.to.group", tsk,"abc@gmail.com"); and also tried sending to 2 users gs.eventQueue("sc_task.assigned.to.group", tsk,"abc@gmail.com", "xyz@gmail.com");

 

Event Parameter 1 and Event Paramenter 2 is also checked in that notification.

 

But it is only getting recorded in event log, in email log nothing is getting sent.

 

Thanks,

Lavanya

Hi Lavanya,

Is email sending enabled in your instance?

left nav email properties

find_real_file.png

If my reply solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

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

Hi Ankur,

 

Yes both email sending and receiving are checked.

 

Email Script:

var grScTask = new GlideRecord('sc_task');
grScTask.addEncodedQuery("request_item.cat_item.sys_id=7c81caf91b5010103480fc86cc4bcb59^short_description=Task 1^state=1");
grScTask.orderByDesc('sys_created_on');
grScTask.setLimit(1);
grScTask.query();
if(grScTask.next())
{
gs.log("Running Email script .....");
var address = "abc@gmail.com";
var name = "ABC";
email.addAddress("to", address,name);
template.print(address);
email_action.recipient_users += address+",";
}

 

Can I use something like above, setting a recipient user. Please help me on this setting email script if we can do this.

Hi Lavanya,

you can only set cc and bcc users via email script and not the recipient

Are you using proper email address? is abc@gmail.com proper email

Please give some valid email address and check

Regards
Ankur

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