How to update short description and Description in REQ using inbound emails

Renu9
Tera Contributor

Hi All,

I am triggering a catalog item using an inbound email action where in a request gets created. But I see request short description and description fields are empty.

Inbound email is on sc_cart table. I am writing short description and description values in RITM and also in SCTask using the workflow which is on RITM table. Please guide me how to achieve of a short description and description values in REQ record.

 

var cartId = GlideGuid.generate(null);

    var cart = new Cart(cartId);

    var item = cart.addItem('a9503cff875e059025d00fe60cbb3584'); // Catalog item sys_id 

              

                 cart.setVariable(item, 'employee_no', email.body.employee_number.toString());

                 cart.setVariable(item, 'employee_name', email.body.employee_name.toString());

                 cart.setVariable(item, 'country', email.body.country.toString());

       var rc = cart.placeOrder();

 

6 REPLIES 6

Murthy Ch
Giga Sage

Hi @Renu

In the same workflow you can also update the Request fields.

Try something like below in Run script:

var grD=new GlideRecord("sc_request");
if(grD.get(current.getValue("request"))
{
grD.short_description="Update here";
grD.description="Update here";
grD.update();
}

Thanks,

Murthy

Thanks,
Murthy

Renu9
Tera Contributor

Hi Murthy,

Tried this, it is creating 2 requests at a time with one Desc and short desc updated in REQ and the other one without.

 

 

Renu9
Tera Contributor

Hi Murthy, It didnt work for my case. Tried with another option and it started working. Added statically short description and description values in BR before cart.placeOrder();

 

Glad, you have achieved by yourself.

 

Thanks,
Murthy