Inbound action

Ramkumar Thanga
Mega Sage

Hi All,

 

I have created a inbound action to create requested items. with the following condition "email.to.indexOf("abc@xyz.com") > -1". While testing by sending an email to "abc@xyz.com", the inbound action got skipped  and the target is empty in  email logs, but requested item got created with the subject of the email. So please help me in trouble shooting this issue.

 
 
 

email.to.indexOf("abc@xyz.com") > -1

 

Script used to create ritm: 

 

var myCart = new Cart(null,current.u_requested_for.sys_id);
var CatItem = new GlideRecord('sc_cat_item');
CatItem.addQuery('name','Xyz');
CatItem.query();
if(CatItem.next()){
var myItem = myCart.addItem(CatItem.sys_id);
myCart.setVariable(myItem,'requester',gs.getUserID());
myCart.setVariable(myItem,'Short_Description',email.subject);//email.body.description
myCart.setVariable(myItem,'Description',email.body_text);
myCart.setVariable(myItem,'cat_assignment_group', 'xyz' );
var myOrder = myCart.placeOrder();
myOrder.requested_for = gs.getUserID();
myOrder.insert();
}

 

Thanks,

Ram

2 REPLIES 2

Ramkumar Thanga
Mega Sage

Hi All,

 

I have created a inbound action to create requested items. with the following condition "email.to.indexOf("abc@xyz.com") > -1". While testing by sending an email to "abc@xyz.com", the inbound action got skipped  and the target is empty in  email logs, but requested item got created with the subject of the email. So please help me in trouble shooting this issue.

 

 

Target table: sc_req_item

Action type: Record action

Type: New

Condition: email.to.indexOf("abc@xyz.com") > -1

 

 

Script used to create ritm: 

 

var myCart = new Cart(null,current.u_requested_for.sys_id);
var CatItem = new GlideRecord('sc_cat_item');
CatItem.addQuery('name','Xyz');
CatItem.query();
if(CatItem.next()){
var myItem = myCart.addItem(CatItem.sys_id);
myCart.setVariable(myItem,'requester',gs.getUserID());
myCart.setVariable(myItem,'Short_Description',email.subject);//email.body.description
myCart.setVariable(myItem,'Description',email.body_text);
myCart.setVariable(myItem,'cat_assignment_group', 'xyz' );
var myOrder = myCart.placeOrder();
myOrder.requested_for = gs.getUserID();
myOrder.insert();
}

 

Thanks,

Ram

kchorny
Tera Guru

You probably have already solved this, but your condition should be email.recipients.indexOf("abc@xyz.com") > -1