The CreatorCon Call for Content is officially open! Get started here.

inbound email action script

Yougander patel
Tera Contributor

hello,

 

iam unable to create an Ritm  Via inbound email action

 

as steps i followed

 

1. i have created an email distribution group as email xyz@gmail.com 

 

2.And i created an inbound email action using cart Api where below code

 

(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
   
 var xyz = email.body.xyz;
 -----
-----
    //create a cart
    var cart = new cart();

    //add request item to the cart
    addItemToCart(' sys_id');

    //submit the order to create a new REQUEST.
    cart.placeOrder();

    function addItemToCart(item_sys_id) {
        //add item to cart
        var item = cart.addItem(item_sys_id);
        //set values of the catalog variables.
       
        cart.setVariable(item, ' xyz', xyz);
      ----

}

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

 

 

so when i sent an email from xyz@gmail.com to "itdesk" then ritm should create ,but by using above code iam unable to create the ritm

 

and getting an error in email logs that " Email Processing : did not create or update sc_request using current"

 

 

1 REPLY 1

Sujatha V M
Kilo Patron
Kilo Patron

@Yougander patel : Please find the links below for reference which might help for your issue, 

 

https://www.servicenow.com/community/developer-forum/issue-with-cartapi-did-not-create-or-update-sc-...

 

https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server/sn_sc-namespace/c_CartJS...

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.