Sending IT problems to SNC using email address of responsible IT service team

General Add comments
by:

Companies often have more than one IT Service team for solving IT problems. In particular international companies since they often have departments geographical spread over the world.
When an IT user has a problem and sends a request to the responsible IT Service team, he might send the email directly.
It’s also common that each service team has its own specific email address for receiving IT requests

How does Service-now.com challenge this case – because out-of-the-box IT users only are able to send an email to SNC using the syntax <instance name>@service-now.com.
For instance – if the instance is called MyCompany email can be send to MyCompany@service-now.com.

Looking at our case the default approach is not desirable because IT users are not aware of the SNC system and they normally prefer to send directly to the team they know.
What should be done in Service-now.com to arrange this?

This article describes a way on how this can be done, using an email forwarder which actually catches the email of the IT user and forwards this to SNC.
Additional configuration steps are also needed in SNC to get this to work.

The advantage of this approach is that it’s transparent for the IT user who has no clue of the name of the SNC system.
Basically, the IT user sends a ‘problem’ email to a Local Service Team for which has email address localserviceteam@myCompany.com.

The email address is caught by the mail forwarder which is aware of the SNC email address. It forwards the mail to SNC using the address MyCompany@service-now.com.

In SNC an inbound action script reads the receiver field localserviceteam@myCompany.com, which is assigned to Local Service Team.

screenshot - Click to enlarge

Configuring email forwarding

Mail forwarding is normally done by the IT Service team that is responsible for maintaining the email services. In general what happens is that the receiver field in the mail message is not replaced.

Take the following situation. joe.employee@mycompany.com which is an external sender, who has sent an email to localserviceteam@mycompany.com.  
localserviceteam@mycompany.com has a forward set up to mycompany@service-now.com.

So these are the addresses we are looking at:

Original Sender 

Original Recipient 

Forwarding Address 

joe.employee@mycompany.com

localserviceteam@mycompany.com

mycompany@service-now.com

 

The Envelope Header is what is used for routing the message. It is the MAIL FROM: and RCPT TO: of the SMTP conversation as set out in RFC 5321 and RFC 821.
When the forward process takes place, these will be the values used:

Envelope From 

Envelop To 

Receiver 

joe.employee@mycompany.com

mycompany@service-now.com

localserviceteam@mycompany.com

 

For SNC it looks like the email is directly send to it.

Creating inbound action script

// Array for catching all email addresses the IT users is sending a email to. It’s possible to send email to more then one IT service Team
var rarray = email.recipients_array;

// Walkthrough email array searching for all responsible Service Teams
for (var i = 0; i < rarray.length; i++) {
var recipient = rarray[i];

switch (rarray[i].toUpperCase()) {

// serviceteam@mycompany.com
case “serviceteam@mycompany.com”:
// set sys_id of appropriate assignment_group
current.assignment_group = “3dc03fac0a0aa01200f5603ddd9bdcc3”;

// set all appropriate field values creating a correct Incident record and insert
setupIncRec();
current.insert();
break;

// serviceteam2@mycompany.com

case “serviceteam1@mycompany.com”:

// set sys_id of appropriate assignment_group
current.assignment_group = “3dc03fac0a0aa01200f5603ddd9bdcu8”;

// set all appropriate field values calling function setupIncRec()
setupIncRec();
current.insert();
break;

// serviceteamN@mycompany.com

case “serviceteamN@mycompany.com”:

// set sys_id of appropriate assignment_group
current.assignment_group = “3dc03fac0a0aa01200f5603ddd9bdc13”;

// set all appropriate field values creating a correct Incident record and insert
setupIncRec();
current.insert();
default:
}
}

function setupIncRec() {

var grUser = new GlideRecord(‘sys_user’);
grUser.addQuery(’email’, email.from);
grUser.query();
if(grUser.next()){
// Search in SNC and set user specific information
current.u_site_id = grUser.u_site_id;
current.location = grUser.location;
current.u_business_phone = grUser.phone;
}
// Copy and past information inherit from email message
current.opened_by = email.user_id;
current.caller_id = email.user_id;
current.short_description = email.subject;
current.comments = email.subject + ‘\n’ + email.body_text;
}


If you have any question about this, don’t hesitate and drop me a mail at mike.floris@2e2.nl .

Leave a Reply