Email Notifications based on Parent Record

Mark_Didrikson
ServiceNow Employee
ServiceNow Employee

Hello,

I would like to trigger some Change Task notifications when the State on the Parent Change Request is updated to certain values. Should this work using the notifications based on when a record is "Inserted or Updated"? It seem like it should, but it does not appear to be. I have attached a screenshot of what I am trying to do. Or won't this work because the Change Task record is never actually updated?

Thanks!

4 REPLIES 4

Kostya
Tera Guru

Hello,

another approach to fire an event in the business rule of the parent record and instead of passing the parent object to rhe event queue you can pass the child object.

F.e.

When: onBefore
Update: true
Table: Change Request
Condition: current.state.changesFrom("Draft") && current.state.changesTo("Review")


// code: create GlideRecord for change_task and get all records with parent change = current.sys_id
// then create an event for each child record
gs.eventQueue("change_task.parent_changed", gr_change_task, gs.getUserID(), gs.getUserName());


You have to create an email notification for Change tasks than.

Kind regards


Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya

Jim Coyne
Kilo Patron

Is the "Send to event creator" field checked? Depending on the version of the instance, you may have to change to the Advanced view to see it.

The person modifying the record will not get an email if that field is not checked. So the email notification may in fact be "working", but just not sending any emails out to the tester. It can be a misleading.


TJW2
Mega Guru

You will have to go with the 'trigger' an event route. The 'conditions on insert/update' on a notification will NOT register if the actual record is NOT updated.


Mark_Didrikson
ServiceNow Employee
ServiceNow Employee

Thanks! I will either update the record or trigger an event.