Work-around for Inbound Action Skipped for Inactive User

Mike Cory
Tera Contributor

Hi,

Problem:

We have a case where some users (vendor types with AD accounts) send emails to trigger an Inbound Action to create an incident.  These users don't typically login to the Portal due to some workflow complications on their end so when their AD account is disabled per a 90-day no-use AD policy, the User's SN account becomes inactive via Azure sync. The Users still need to send an email to our SN Instance Email address to create an Incident, but the Inbound Action isn't triggered because the SN User Account is inactive and the sent email gets flagged as "received-ignored".  The User in this case has no idea that their AD account is disabled, their ServiceNow User account is inactive, and that the email they are sending does not process in ServiceNow.

 

Question:

For Inactive Users that send an email to our SN Instance email address, is there a way to trigger an email back to that User?  The intent of sending an email back is to let the User know that their AD account is disabled and to have the User contact our Service Desk.

 

Thank you.

Mike

4 REPLIES 4

Tony Chatfield1
Kilo Patron

Hi, if I recall correctly these emails are moved to the 'junk' folder if the user is inactive and\or locked out.
I would look at creating an after update BR for sys_email table where mailbox = junk and in the script trigger a sysevent that you can then consume in a notification advising the users that their account is locked.

Events (servicenow.com)

GlideSystem | ServiceNow Developers

 

Hi Tony,

Thanks for the information and sorry for the late reply.  Below are the steps I have taken, but I’m not getting a reply back to the User (ESS Test) that sent the email.  I assume something in the BR Script, but don’t know what?  Screen shots attached.

  • Set User (ESS Test) to inactive in ServiceNow User table.
  • Created Business Rule (Notify Inactive User)
    Business Rule created on Email (sys_email) table.
    When to run (After & Update)
    Conditions:
    •  Mailbox is Junk
    •  User ID is ESS Test
    •  Subject <contains> PDS

BR Script:

(function executeRule(current, previous /*null when async*/) {

gs.eventQueue('notify.inactive_user', current, 'parm1','parm2',gs.getUserID(), gs.getUserName());

})(current, previous);

  • Created Event (notify.inactive_user)

    Event created on Email (sys_email) table.

  • Created Notification (Notify Inactive User)
    Notification created on Email (sys_email) table
    Triggered by Event (notify.inactive_user)

TEST

  1. Login to PC as ESS Test User
  2. Send email to our ServiceNow DEV Instance email address with PDS in the Subject

TEST Result

  • Email recognizes User ID is inactive and sends email to Junk folder.
  • An email is NOT sent back to ESS Test User

Hi Mike

 

OOTB functionality will not send emails to inactive users.
So I would update your BR and put the inbound email in parm1

(function executeRule(current, previous /*null when async*/) {

gs.eventQueue('notify.inactive_user', current, '<insert email address here>','parm2',gs.getUserID(), gs.getUserName());

})(current, previous);

Divya Dahate
Tera Expert

Hello Mike,

 

I want to prevent creating incidents via email if the sender's email ID is blank/the sender account is inactive in the user table, Do you have any idea how can I do this?

 

Also, we created more than 200+ inbound actions to create incidents based on different conditions/ subject lines we want the same functionality for this inbound action also.

if the sender is inactive incident should not be created.

 

Thanks,

Divya