Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

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

6 REPLIES 6

Ankur Bawiskar
Tera Patron

@tulasi8 

what's your exact business requirement?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Tera Patron

Hi @tulasi8 

 

Try this:

 

 

 

Inbound Email Action Configuration

  • Name: Conditional RITM from Email
  • Table: Requested Item [sc_req_item] (or Global)
  • Type: Reply email
  • Active: true
  • Stop processing: true

 

(function runAction(current, email, event, logger, classifier) {

    var subjectLower = email.subject.toLowerCase();

     var containRE = (subjectLower.indexOf('re:') > -1);   

    if (containRE) {

        action.setAbortAction(true);

        gs.log("Inbound Email Ignored: 'RE' found in subject line for email: " + email.subject);     

    } else {

          var cart = new Cart();

        var item = cart.addItem('YOUR_CATALOG_ITEM_SYS_ID');

        cart.setVariable(item, 'description', email.body_text);

        var rc = cart.placeOrder(); // Creates the REQ and associated RITM

       

        gs.log("New Request and RITM created from inbound email. Subject: " + email.subject);

    }

 

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

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti