Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Send email notification to user who updated ticket ('updated by' field?)

leochavez
Tera Guru

I've created a email notification that will send an email notification to a user (Updated By) who added additional comments, or replied to an email, to a closed RITM.   Details as follows:

  • Table: sc_req_item
  • Condition:   RITM state is 'closed complete' OR 'closed incomplete' OR 'closed cancelled' OR 'closed converted' AND 'additional comments' have changed
  • Recipient: Added 'Updated By' within 'Users/Groups in fields'

To test, I located a 'closed' RITM, added additional comments, and updated the RITM.   No email notifications arrived locally or were displayed within 'Mailbox > Sent'.  

However, when I add my email to 'Users', I receive the email notification locally and see it within 'Mailbox > Sent'.

Is the 'Updated By' the wrong field to use?   What am I missing here?

- Leo

1 ACCEPTED SOLUTION

leochavez
Tera Guru

Using the 'sys_id' is a great idea, but it assumes the person replying can be found within the system.   Unfortunately for me, that solution won't work. Here's a scenario....



Lets say a request/incident was opened and email 'leo123@xyz.com' was added to the watch list.   Although that email is not associated with any user found within the system, it notifications would still be sent to that email.   When the ticket is closed, a reply could still be sent using the 'leo123@xyz.com' email, however, that email is not tied to an actual system user,…making it difficult to locate the user [sys_id] and inform them that the ticket was closed.



To bypass this issue, I created an inbound email action (IEA) and event registry (EV).   Within the IEA, I called the EV and passed the senders email address as the 1st event parameter.   Within the notification, I set the 'Send when' to 'Event is fired', set the event, and marked the '' checkbox.



Thank you both for your proposals,



- Leo


View solution in original post

3 REPLIES 3

veena_kvkk88
Mega Guru

Hi Leo,



I believe the field is the issue because the updated by field is not a reference to the User table, but a simple string.


Alikutty A
Tera Sage

The updated by should be a string field and you can trigger this notification through an event when your task is updated. The sys_id of the updated by user can be passed as an event parameter to your notification. Also make sure you check the send to event creator checkbox in your notification.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


leochavez
Tera Guru

Using the 'sys_id' is a great idea, but it assumes the person replying can be found within the system.   Unfortunately for me, that solution won't work. Here's a scenario....



Lets say a request/incident was opened and email 'leo123@xyz.com' was added to the watch list.   Although that email is not associated with any user found within the system, it notifications would still be sent to that email.   When the ticket is closed, a reply could still be sent using the 'leo123@xyz.com' email, however, that email is not tied to an actual system user,…making it difficult to locate the user [sys_id] and inform them that the ticket was closed.



To bypass this issue, I created an inbound email action (IEA) and event registry (EV).   Within the IEA, I called the EV and passed the senders email address as the 1st event parameter.   Within the notification, I set the 'Send when' to 'Event is fired', set the event, and marked the '' checkbox.



Thank you both for your proposals,



- Leo