Sending notifications to the sender

Dubz
Mega Sage

Hi,

I have a notification set up to send to anyone who is emailing a closed Incident saying words to the effect of 'this incident is closed, click here to raise a new one'. The trouble i'm having is getting this to send back to whoever emails the closed ticket.

I don't want to spam everyone on the watchlist just because 1 guy decided to try and resurrect an old ticket so i'm trying to send to the 'updated by' field. The problem with this is that the updated by field isn't referencing the user table, it's just displaying the user ID which in our case, is not an email address.

Even if we can change that field to reference the user table, if someone emails in who is not in the user table, they won't receive the notification telling them the ticket is closed.

Is there a way to pull out the senders address from an incoming email and send the notification to that address?

Cheers

Dave

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi David,



Yes, you have two choices as you noted. The first is to use the user id in the sys_updated field and do a lookup from the sys_user table (eg. something like this)



var user = GlideRecord('sys_user');


if (user.get('user_name', current.sys_updated_by)) {


        // user found - do something here


}



The issue, as you noted is that the record may not be updated by someone in the sys_user table, in that case you would need to trigger the message from the incoming mail and use the from address as the to address.



Take a look at triggering email by event (using the gs.eventQueue() method) and send the recipient's address as one of the two parameters (parm1 or parm2) in that call. The notification record has a field that allows you to use one of those parameters as the address - you need to click the Advanced view link to see that field after selecting to send by event (not record inserted or updated.)



Events and Email Notification - ServiceNow Wiki


View solution in original post

5 REPLIES 5

The script action is going to process your incoming message. It alone knows the sender's (From: ) email address. If you generate the event from within the email inbound action you can then trigger the outbound notification immediately.



I don't quite see how a script action fits in to this equation. Script actions are triggered from events as well (much like business rules are triggered from database operations), but the script action doesn't send the notification, it only runs more server script.