Email inbound action

nanichaitu
Tera Contributor

if an email is sent ABC@comapnay.com , An incident is created. Now my requirement is in same instance, i have to create incidents if i sent an email to xyz@company.com . As of now we are using Service now ServiceNow SMTP and Servicenow Pop3. 

1 ACCEPTED SOLUTION

Hi nanichaitu,

 

I sent a reply to the email with your question yesterday but I'm not seeing it here so here's what I said then:

 

Sent, Outbound, Incoming and Received are all existing mailboxes.  If you need to set up a new mailbox, you certainly can.  However then you will also need to handle what goes to that mailbox.  Adding a mailbox won’t impact your existing inbound actions since they work when an incoming email moves from inbound to received.

 

If you need to move received or sent emails to some new mailbox you can do that, for incoming via your existing inbound actions.  As mentioned above, for sent you are best to use a business rule.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

View solution in original post

4 REPLIES 4

johnfeist
Mega Sage
Mega Sage

Hi nanichaitu,

 

Your question is a little light on details so I'll try to provide an answer.  For the moment, let's not worry about which email recipients need to generate an incident.  The easiest thing is to create an after insert business rule on the sys_email table.  You will want the mailbox to be sent.  From there your scripting is pretty simple:

var theIncident = new GlideRecord("incident");
theIncident.initialize();
theIncident.setValue("caller_id", current.email_to);
theIncident.setValue("short_description", current.subject);
theIncident.setValue("assignment_gorup", <whichever group is appropriate>);
theIncident.setValue("contact_type", "email");
theIncident.insert();

You can add any other fields that need to be set at creation.

 

If you will only be sending to the one recipient, this will work nicely.  If you may have xyz@company.com as one of many, you will need to do a split on the recipients to find that person.

 

The other consideration is how many recipients will need to have incidents created after an email is sent.  If it is a short list, probably the best thing is to create a property that has the list which you can easily search via indexOf().  If the list is more extensive and the recipients are part of your user community, try adding a checkbox to the user record so that you can do a lookup to the user record based on the email and if the box is checked, create the incident.

 

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

my worry is will there be any impact on existing inbound actions? if i configure new email box?

Hi nanichaitu,

 

I sent a reply to the email with your question yesterday but I'm not seeing it here so here's what I said then:

 

Sent, Outbound, Incoming and Received are all existing mailboxes.  If you need to set up a new mailbox, you certainly can.  However then you will also need to handle what goes to that mailbox.  Adding a mailbox won’t impact your existing inbound actions since they work when an incoming email moves from inbound to received.

 

If you need to move received or sent emails to some new mailbox you can do that, for incoming via your existing inbound actions.  As mentioned above, for sent you are best to use a business rule.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

I also explored flow designer instead of Business rule