Need to test inbound Action

Abdul
Tera Contributor

i am trying to validate the inbound Action of creation of an Incident in our lower environment.

The email which is being sent to 

merchandising.servicenow@parkland.ca

should create an Incident.

To test this i have selected a previous email with type as received and in the place of the recipients i removed the earlier one and then used this email id saved it and then reprocessed it.

The Incident is not getting created.

 

Is this the correct way to test?

Please let me know.

 

Thanks  

11 REPLIES 11

Hi there are no conditions in the inbound action plain and simple code as below 

 

Also i did try to reprocess it , its not working 😞 

//  Note: current.opened_by is already set to the first UserID that matches the From: email address

current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.description = email.body_text;

current.category = gs.getProperty('pfc.inbound_action.incident.default_category');
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
/*09/14/2022 - STRY0010687 - abounyavet
- Set Urgency - 2 - Low and Impact -2 - Low so Priority defaults to 3 - Moderate
- Default was Urgency 3 - Low, Impact 3 - Low, and Priority 5 - Planning
*/
current.impact = 3;
current.urgency = 3;

if (email.body.assign != undefined)
   current.assigned_to = email.body.assign;

if(email.subject.indexOf('RDM - ') > -1) {
    current.setDisplayValue('assignment_group', 'Service Desk  Tier 2 ServiceNow');
}

if (email.importance != undefined) {
   if (email.importance.toLowerCase() == "high")
      current.priority = 1;
}

if (email.body.priority != undefined)
   current.priority = email.body.priority;

current.insert();

Neeraj31
Mega Sage

@Abdul Recipients field contains the list of emails to whom servicenow sends the email. In case of received emails, you need to update the email ID in User field to test your scenario.

 

Please mark as Correct Answer and Helpful, if applicable.

Abdul
Tera Contributor

actually the email that i have is a group email, if an email is sent to the group then it should create an incidnet

Abdul
Tera Contributor

Hi can someone please help me with this

@Abdul What configuration you have done for email redirection? Is the group email ID redirecting email to Servicenow? If yes, then trigger one email and check the fields of email in Servicenow which field contains what values.
Also, Share the Inbound email configuration.