Send notification to 'Assigned To' on change task

Rocky5
Kilo Sage

Hello Experts,

 

I have a requirement. When change request state is changed from ‘New’ state. I want to send notification to change task’s assigned to user.

 

I have built notification on change task table with condition by dot-walking as “change request.state-changes from- New” (below screenshot) but the notification is not triggering. 

Rocky5_1-1677605969863.png

 

 

What could be the issue and Any workaround?

Thanks in advance,

Rocky.

1 ACCEPTED SOLUTION

Hello,

Please create an event: https://docs.servicenow.com/en-US/bundle/utah-platform-administration/page/administer/platform-event... 

Please create an "after" business rule on the parent table and with conditions such as the state changes from 'x' :  https://docs.servicenow.com/bundle/tokyo-application-development/page/script/business-rules/concept/... 

Please add appropriate script to your business rule such as:

 

var gr = new GlideRecord('change_task');
gr.addQuery('change_request', current.sys_id);
gr.query();
while (gr.next()) {
gs.eventQueue('name_of_event', gr, '', '');
}

 

Please change your current notification to send when the event is triggered instead of the current conditions ensuring you've set the assigned_to field in the who to send to tab as appropriate.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

8 REPLIES 8

jcmings
Mega Sage

It looks like your notification fires on Insert! Try changing to Update. Also, note that your notification will only fire when the case changes from New status to its next status. Once the case changes to its third status, a notification will not fire. Just something to keep in mind if you want to send more notifications for other statuses.

Hello Jc,

 

I checked both insert and update checkboxes. so, It should be triggering on update as well but it is not triggered. 

Like Allen said, I may have to create event and business rules. but I am not aware of it. any input?

 

Thanks,

Rocky.

Keep playing around with the condition. You shouldn't need to build a separate event to have notifications fire. Also--why are you dotwalking to State? Why not just build off the Change Request table?

 

Make sure the assigned users have emails on their user profile. Otherwise it will not send.

Kamva
Giga Guru

Hi @Rocky5 ,

 

  1. According to your condition shown on the screenshot, this notification should trigger on insert. I think it should trigger on the Updated as well. Please be sure that the updated check box is marked.
  2. Please be sure that you have selected the Assigned to field for Users/Groups in fields from the Who will receive tab
    Kamva_0-1677614450174.png

     

  3.  If all the above is done, created the change and check the email logs sys_email.list  to confirm none of the emails are from this notification. If you find any, that means your instance is prohibited from sending emails. To enable your instance to send emails go-to: System Properties > Email Properties

    Kamva_1-1677614743111.png