How to auto create incident if email is received for particular mailbox?

nivea
Tera Contributor

Hi All,

I've a requirement to auto create incidents if email is sent to a particular mailbox(functional.tblr@asd.com).

Can anyone help me on how to achieve this for specific mailbox in production environment?

 

Thanks,

Nivea.

4 REPLIES 4

Community Alums
Not applicable

Hi @nivea ,

There is an OOB Email Inbound Action, 'Create Incident', which will do this work. But there are a couple of things that you would need to do:

1. Create a new user or edit an existing user with email address same as the one, from which you are going to send the email. So, you should have a user with same email address as of yours to send the email to ServiceNow.

2. The ServiceNow email address to which email needs to be sent can be found in the 'User name' field on Email Accounts. To locate that, navigate to System Mailboxes -> Administration -> Email Accounts -> ServiceNow SMTP record. Open it and locate the User name field.

3. Navigate to System Mailboxes -> Email properties. Under the Inbound Email Configuration heading, enable Email receiving by selecting the checkbox and then saving it.

4. Now, send an email from the configured email address (your email address) to the ServiceNow email address and refresh the Incident list. You may check the Email Logs (System Logs -> Emails) and locate the email that you sent and the new corresponding incident that opened up in response to that email.

 

Also,

This section provides a very simple example of how to create a domain-specific inbound email action.

  1. Make sure Domain Separation is active in your instance and the global domain is selected on the domain picker.

  2. Navigate to System Policy > Email > Inbound Actions and click New.

  3. Provide the following values:

    • Name: Create Incident – Oceanic
    • Target Table: Incident [incident]
    • Active: Check
    • Script:
    (function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
       if(gs.getUser().getDomainID() != 'c9434fce4a3623120181f955f4a3d6e9'){
          current.caller_id = gs.getUserID();
          current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
          current.short_description = "For Oceanic Domain : " + email.subject;
          current.category = "inquiry";
          current.incident_state = IncidentState.NEW;
          current.notify = 2;
          current.contact_type = "email";
          if (email.body.assign != undefined)
             current.assigned_to = email.body.assign;
          if (email.importance != undefined) {
             if (email.importance.toLowerCase() == "high")
                current.priority = 1;
          }
          if (email.body.priority != undefined)
             current.priority = email.body.priority;
             current.insert();
          }
       })(current, event, email, logger, classifier);
  4. Deactivate the Create Incident Inbound Action.

    1. Go to https://<instance>.service-now.com/nav_to.do?uri=sysevent_in_email_action.do?sys_id=3ccfeff5c611227a0180144333c87af9.

    2. Uncheck Active.

    3. Save the record.

  5. Navigate to User Administration > Users, then select the demo user Abel Tuter.

  6. Change Email to an email ID that you can also use, and change its domain to Oceanic Airlines.

  7. Send an email message to your ServiceNow instance's email ID from the email ID value you set.

    These steps create an Incident on the Oceanic Airlines domain. To check whether this inbound action works only on the Oceanic Airlines domain, send an email message from any other email ID that is associated with a user who does not belong to the Oceanic Airlines domain.

 

Please mark my answer as Correct & Helpful, if applicable.

Thanks

Sandeep

Hi Sandeep,

Thanks for your quick response !

I have a OOB inbound action which will create incident if it receives any email to our prod mailbox. I do not want to deactivate this. 

I want to create one more inbound action separately which should automatically create p2 incident if any user send email to this "functional.tblr@asd.com" mailbox. I've created a user account with this email id but not sure how to configure inbound action if any user sends email to this mailbox ?

Can you help to configure this?

 

Thanks,

Nivea.

Shridhar1
Tera Contributor

Hello Nivea,

Please let me know if you found resolution on this requirement.

If yes, please share details here

 

Thanks

Were able to solve this? I have the same requirement.