Get value of updated field for notification

Bidduam
Tera Guru

I would like to be able to generate a notification when someone returns an asset. 

Wondering how I can automate it to the correct person after their name has been removed from the field already.

EG: 

Joe Bloggs is the person in the assigned_to field for asset xyzabc

Joe returns the asset and is removed from the field (it remains blank) and the asset is updated, at this point I'd like a notification sent to Joe Bloggs advising that he has returned the asset - sort of like a receipt in case later someone asks him where it is, he can prove he returned it.

 

Ideas?

1 ACCEPTED SOLUTION

please use previous object in BR script

(function executeRule(current, previous /*null when async*/) {
gs.eventQueue('asset.assigned.removed', current, previous.assigned_to.email.toString());
})(current, previous);

 

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

View solution in original post

7 REPLIES 7

please use previous object in BR script

(function executeRule(current, previous /*null when async*/) {
gs.eventQueue('asset.assigned.removed', current, previous.assigned_to.email.toString());
})(current, previous);

 

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

Thank you very much @Ankur Bawiskar that worked perfectly 🙂

 

@Ankur Bawiskar Do you know of a way to prompt for an email address that can then be used to send the notification to? In this case it would be to add a personal email address for someone who is leaving the organisation.

Musab Rasheed
Tera Sage
Tera Sage

In BR you can write something like this and call event in notification.

MusabRasheed_0-1665382134812.png

 

Feel free to mark both solution as correct

Please hit like and mark my response as correct if that helps
Regards,
Musab