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

Allen Andreas
Administrator
Administrator

Hi,

That will only be evaluated when the record on that table is updated. Since the change relies on the parent record, this wouldn't trigger. You can create an event and then in a business rule on the change_request table to fire that event for all related change request tasks. For this notification, you can change it to trigger when the event is fired.

https://docs.servicenow.com/bundle/tokyo-platform-administration/page/administer/platform-events/tas...


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

Hello Allen,

 

Thank you for the response. May I ask you if you can help me with the BR and event? Sorry but I'm not that strong in scripting.

 

Thanks,

Rocky.

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!

Hi @Rocky5 

I can see discussion in the other reply chain below that appears to suggest differently than what I'm saying above, so I'll let that work itself out, but per the system...a notification will not fire when reliant upon a parent record change. A business rule also will not execute when reliant upon a parent record change. This is why I've suggested what I have above and why the business rule I'm saying to create would be on the parent table and then fire the following processes.


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