How to update short description and Description in REQ using inbound emails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2022 04:02 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2022 04:34 AM
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
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2022 05:27 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 06:20 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 11:04 PM
Glad, you have achieved by yourself.
Murthy