Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Reply Type Inbound Email Action

tulasi8
Tera Contributor

Hi Community,

 

Can anyone please say whether this was the best practice or not in ServiceNow ?If No, what are the issues we face if configured this action .  If yes , how can we implement this ? @Ankur Bawiskar @Dr Atul G- LNG 

 

create "reply" inbound email action 

and give conditions like "if there is RE in subject " don't create RITM

"if there is NO RE in subject " then create RITM.

 

Regards,

Tulasi

4 REPLIES 4

Dr Atul G- LNG
Tera Patron

Hi @tulasi8 

You can use this approach, but I doubt it is the best way. Since there is a space between the two words, using a single Contains condition to perform the action means that if the condition fails, no action will be taken. Give it a try, but it would be better to use an If condition with the required actions in Flow Designer.

 

DrAtulGLNG_0-1785408046948.png

 

https://www.servicenow.com/community/developer-forum/inbound-action-if-subject-contains-quot-ticket-...

 

DrAtulGLNG_1-1785408207542.png

https://www.servicenow.com/community/incident-management-forum/inbound-action-regex-condition/m-p/24...

 

email.subject.toLowerCase().indexOf(' dl ') > -1 || email.subject.toLowerCase().indexOf('distribution list') > -1

 

*************************************************************************************************************
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

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

Nilesh Pol
Kilo Sage

@tulasi8 

This is not considered a best practice in ServiceNow if the only logic is based on checking whether the subject contains "RE:" or not.
 

Instead of checking only "RE:":


First check whether the email belongs to an existing record using:

Watermark
Record Number

If an existing record is identified:

Update the existing record.
Add comments/work notes.

If no matching record is found:

Create a new Request/RITM.

This is how standard ServiceNow inbound email processing is typically handled.

As of now, we have only new and forward inbound email actions configured. In this scenario, the user replied to an existing email thread and sent the email to a distribution list requesting a new request creation; however, ServiceNow classified the inbound email as a reply due to the existing email thread/watermark and therefore did not trigger the logic to create a new RITM. How can we handle this use case and ensure an RITM is created when such reply emails are received?

 

@tulasi8 When a user replies to an old email thread and sends it to the distribution list:

ServiceNow detects the watermark.
Email type becomes Reply.
New Inbound Action is skipped.
No RITM gets created.

 

Create a Reply inbound email action specifically to handle this use case. and Check for indicators that the user wants a new request:

Subject contains "NEW REQUEST"
Email body contains "Create new request"
Sent to a dedicated mailbox/distribution group

var createNewRITM = false;

if (email.subject.toLowerCase().indexOf('[new request]') > -1) {
    createNewRITM = true;
}

if (email.body_text.toLowerCase().indexOf('create new request') > -1) {
    createNewRITM = true;
}

if (createNewRITM) {

    // Create Request/RITM

    var reqItem = new GlideRecord('sc_req_item');
    reqItem.initialize();

    reqItem.short_description = email.subject;
    reqItem.description = email.body_text;

    reqItem.insert();

    action.setAbortAction(true);
}