Inbound Action to create Request & Requested Item failed

MWright1
Giga Guru

Getting this in the Email log:

Create Video Conferencing Req (forward) : did not create or update sc_req_item using current

 

This is my Inbound Action:

createRequest();

function createRequest() {
    var user_sys_id = gs.getUserID();
    var comments = email.body_text;
    var subject = email.subject;
    var body = email.body_html;
    var cart = new Cart(); //calling the cart API
    var item = cart.addItem('0520833f1b4fc2902bea0fa4cc4bcb92'); //sys_id of the catalog item I want to fire

    cart.setVariable(item, 'short_description', subject ); //sets catalog variable to the email's subject
    cart.setVariable(item, 'comments', body); //sets catalog variable to email's body

    var rc = cart.placeOrder(); //this launches the catalog item, and creates a request object. 
    updateRITM(rc.sys_id, body, comments); //call a function immediately to update the ritm.   
}

function updateRITM(req, body, comments, subject) {
    var ritm = new GlideRecord('sc_req_item');
    ritm.addQuery('request', req); 
    ritm.query();

    while (ritm.next()) {
        ritm.comments = comments;
        ritm.short_description = subject;

        ritm.assignment_group = '9a1540151b97ce106d0c33b4cc4bcb16';
        ritm.update();
    }

}

 

The Catalog Item has Any User as Available for which allows anyone to create.  I don't know what else I am missing.  Please help.

 

Thanks,

M

 

 

 

5 REPLIES 5

Thanks.   Will compare for sure.

 

Both emails have FW:.  Considering that the Inbound Action triggers (it is set to Forward).  That may not be an issue.  It just won't create the RITM.