- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 10:03 AM
Hi,
I have an inbound action that creates RITM thru CART API.
Everything is working fine, RITM is created but attachments are not included on the RITM ticket.
I might be missing something on my inbound action... any advices?
createRequest();
function createRequest() {
var cart = new Cart();
// add in cart
var item = cart.addItem('62d832d56f8721006e3f4425eb3ee4b4');
cart.setVariable(item, 'cleanupgensubject', email.subject.toString());
cart.setVariable(item, 'cleanUpgenDetails', email.body_html);
var cartmsg = "received from: " + email.origemail + "\n\n" + email.body_text;
var rc = cart.placeOrder();
}
Thank you very much.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2014 09:24 AM
Hi Azenith,
You need to add the below code after placing the order in the cart:
var ritmSysID = "";
var ritmRec = new GlideRecord("sc_req_item");
ritmRec.addQuery("request", rc.sys_id);
ritmRec.query();
if(ritmRec.next()){
ritmSysID = ritmRec.sys_id;
}
Thanks,
CK

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2014 09:36 AM
Yep this would be the way to grab the ritm id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2014 10:02 AM
Thank you very much CK/Brad.
Working now as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2015 03:13 AM
Hi Azenith,
I am working on the same requirement which you had posted here.
But am not able to copy the attachment to RITM.
Could you please explain me hoe to do it.?
Also, what should be placed in <ritem_sys_id> of below code.
- Packages.com.glide.ui.SysAttachment("sys_email", emailRec.sys_id, "sc_req_item", <ritm_sys_id>);
Thanks in advance.
Regards,
Sowmiya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2015 06:31 AM
the whole code should look like this ...
var cart = new Cart();
var item = cart.addItem('62d832d56f8721006e3f4425eb3ee4b4');
cart.setVariable(item, 'cleanupgensubject', email.subject.toString());
cart.setVariable(item, 'cleanUpgenDetails', email.body_html);
var cartmsg = "received from: " + email.origemail + "\n\n" + email.body_text;
var rc = cart.placeOrder();
var ritmSysID = "";
var ritmRec = new GlideRecord("sc_req_item");
ritmRec.addQuery("request", rc.sys_id);
ritmRec.query();
if(ritmRec.next()){
ritmSysID = ritmRec.sys_id;
}
var emailRec = new GlideRecord("sys_email");
emailRec.addQuery("uid", email.uid);
emailRec.orderByDesc("sys_created_on")
emailRec.query();
if(emailRec.next()){
GlideSysAttachment("sys_email", emailRec.sys_id, "sc_req_item", ritmRec.sys_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2015 08:03 AM
Hi Kalai,
It's not working.
I can see some error while processing the email,
Error processing inbound action 'SAP Workflow'
org.mozilla.javascript.EvaluatorException: Java constructor for "com.glide.ui.SysAttachment" with arguments "string,string,string,string" not found. (<refname>; line 49)
Regards,
Sowmiya M