We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Need help to trigger workflow attached to service cataog by using cartjs api

LydiaChester
Tera Contributor

I am currently using sn_sc.CartJS() to submit a a catlog request using script include which is triggered by a business rule. The catalog item is submitting request successfully, req and ritm are getting created, but the flow attached to the service catalog is not getting triggered. There are a series of actions/ updates in the flow that needs to be triggered. 

1 REPLY 1

LydiaChester
Tera Contributor

Any help is appreciated, Need to know if, by using cartjs to submit a catalog item, the flow will be triggered. currently it is not triggering the flow attached it to the catalog item. this is part of the script include example:

var cart = new sn_sc.CartJS();
            cart.empty();
            var item = {
                'sysparm_id': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX,
                'sysparm_quantity': '1',
                'variables': {
                    'group1': IncAsmntID.toString(),
                    'group12': groupID.toString()
                }
            };
            var cartDetails = cart.addToCart(item);
            //gs.info(JSON.stringify(cartDetails));
            //}
            //var request = cart.orderNow(item);
            var request = cart.submitOrder(item);