Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Create Interaction via Email

Jeroacha
Tera Contributor

I have a problem with an inbound email action "Create Interaction" that creates an interaction via email and populate the opened_for field with de userID from de user who sent the email, I have all de email properties that i need active but when i make a test sending an email to the smtp direction, in the system log of the emails it appears the log corresponding to the test but it sets as deleted and i dont know why this is happening. 
This is de code in the actions tab:

//  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.category = "inquiry";
current.interaction_state = 1;
current.notify = 2;
current.contact_type = "email";
//current.opened_for = gs.getUserID();

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;
   }
}

if (current.canCreate())
    current.insert();
2 REPLIES 2

GlideFather
Tera Patron

olá @Jeroacha,

is the incoming email associated with any user account in ServiceNow? 

I guess this is not a PROD if you are testing it, navigate to to the "Email diagnostic", you will see if it is not blocked.
If it is something else, please share more details - logs or something else.

_____
This reply is 100 % GlideFather and 0 % AI

Yes, but if its not it shouldn't be a problem beacuse there is a proerty eneabled which creates a guest user if the incoming email is not realated to any user in the servicenow table and the interaction caller set as "Guest". I check the "Email diagnostic" and its everything okey. The log of this interaction that should be created via an incoming emal just reflects the deleted field as "true"