Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Business Rule to submit catalog item scoped application.

Ben42
Tera Contributor

Hello,

I am using the below script in Business rule to submit catalog item when a ticket in scoped application is updated.

 

script:

var cart = new sn_sc.CartJS();
    //var cart = new gs.generateGUID(null);
    var request = {
        'sysparm_id': 'b128f81f8765c61486a10d4acfcc3652',
        'sysparm_quantity': '1',
        'variables': {
            'first_name': 'Abel',
            'last_name': 'Tuter'
        }
    };
    var cartDetails1 = cart.addToCart(request);
    gs.info(cartDetails1);
    var checkoutInfo = cart.checkoutCart();
    gs.info(checkoutInfo);
    var cartDetails = cart.orderNow(request);
    gs.info('See Details :', cartDetails);
 
But, it is not working... tried using "var cart = new sn_sc.CartJS();" and also tried using "var cart = new gs.generateGUID(null);" still no luck.
 
Any help is much appreciated. 
 
Thanks,
Ben.
5 REPLIES 5

Did you try it without the 

cart.orderNow(request);
?
Just wondering since I thought it would work with the one order line.