Inbound Email Action Failed

Shaikh2123
Tera Contributor

Hi Team,

 

I have created an inbound email action on the Incident table and I got the below message in the "Email Log Entry" after it is proceed and no incident is created.

 

"Skipping script 'INBOUND ACTION NAME ', condition 'email.origemail.toLowerCase() =='fromemail@gmail.com'' failed"

 

Please see the below details of the inbound action and please help me if i did any mistake

 

Details:

Target Table: Incident

Action Type: Record Action

Stop Processing: True

Subject: subject contains "Amazon App"

Condition: email.origemail.toLowerCase() =='fromemail@gmail.com'

 

Script:

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {

    current.sys_created_by = "8b6ffa581bc73dd0375c0fe3cc4bcb14";
    current.caller_id = "8b6ffa581bc73dd0375c0fe3cc4bcb14";
    current.u_affected_user = "8b6ffa581bc73dd0375c0fe3cc4bcb14"
    current.u_caller_number = "(000)-000-0000";
    current.location = "93d682fe4f344300718356701376b25aa";
    current.short_description = email.subject + "";
    current.description = email.body_text + "";
    current.contact_type = "Automatic call";
    current.assignment_group = "183520541bc03110e13f0f20604bhgr5";
    current.impact = 2;
    current.urgency = 2;
    current.category = 'performance_issue';
    current.subcategory = 'other';
    current.cmdb_ci = '988dcd714f1e4300fbe7d0411310c7g4';
    current.u_what_is_impacted = 'i7d09ac24f1a8300fbe7d0411310887e'
current.insert();

})(current, event, email, logger, classifier);

 

Thanks in advance

4 REPLIES 4

Abbas_5
Tera Sage
Tera Sage

Hello @Shaikh2123,
Please refer to the link below:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538137

 

Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Shaikh2123 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0832542

https://www.servicenow.com/community/developer-forum/quot-skipping-script-process-inbound-email-cond...

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538137

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Rakesh18081
Tera Expert

Try below code

// Inbound Email Action Script

// Check if the email sender matches the specified condition
if (current.origemail && current.origemail.toLowerCase() === 'fromemail@gmail.com') {

// Your existing logic to create an incident or other actions
// ...
// Ensure you include the necessary actions to create an incident

} else {
// Log that the condition is not met
gs.log("Inbound Email Action: Condition not met for sender " + current.origemail);
}

Please mark my answer as helpful and the solutionaccepted if it serves the purpose.

Sandeep Rajput
Tera Patron
Tera Patron

@Shaikh2123 try removing the condition and check if the Inbound works. If it does, you can check if the condition mentioned in the condition field matches with correct email or not.