Need Clarification

Abdul
Tera Contributor

We have a DL in our ServiceNow instance and when an email is sent to the DL's email id. it has to generate an Incident. how can we achieve this?

2 REPLIES 2

Shruti
Mega Sage
Mega Sage

Hi,

 Create Inbound email action 

Condition - email.origemail == "xyz@gmail.com" // replace DL's email

 

 Update Actions script to create incident

    current.caller_id = gs.getUserID();
    current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
    current.short_description = 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.impact = 1;
            current.urgency = 1;
        }
    }

   
    current.insert();

Abdul
Tera Contributor

thank you. how can i test this in my lower instance?

can i use sys_email table to create an entry and test this?