Create incident when an email is sent to a particular email id ex : "axy@ttr.com".

krishna111
Tera Contributor

Hello All,

Hope everyone is doing good , Needed a help in creating a inbound email action to create a incident when an email is sent to "axy@ttr.com". How can we achieve this?

WHEN they send an email to axy@ttr.com

THEN an Incident will be created with the following field values being set: 

  1. Company (Account): axz
  2. Caller: User ID (from requester)
  3. Product or Service: adb
  4. Impact: 2-Medium
  5. Urgency: 2-Medium
  6. Priority: 3-Moderate
  7. Assignment Group: support l1 group
  8. Short description: Email subject
  9. Description: Body of the email

Thanks in advance

kumar

2 REPLIES 2

Community Alums
Not applicable

Hi @krishna111 ,

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.

 

Hello @Community Alums ,

 

Thanks for the reply !!

I want to create one more inbound action separately which should automatically create p2 incident if any user send email to this "axy@ttr.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?