cart API since Quebec Upgrade

jonmulherin
Giga Expert

Since upgrading from Orlando to Quebec cart.placeOrder() is no longer working in our Inbound Actions.  I've logged a ticket with ServiceNow but I'm wondering if anyone has experienced the same.  I creating a very basic Inbound Action on all three of our instances to test with.  It runs find on production and creates a request but only displays the gs.info string just above cart.placeOrder() on the upgraded sub-prod instances.  No ticket is created and the last gs.info never appears in the log.  Here is the test inbound action:

gs.include('validators');
gs.info('Junk - In Junk');
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('29cc96fa4fb18a80acbe01b28110c779');
cart.setVariable(item, 'request_for', 'ac6d82eadbab4050927622e648961931');
cart.setVariable(item, 'growth_center_commercial_team', '83a843fe4f2006005238dd2f0310c7bc');
cart.setVariable(item, 'item', '2ebce4b34fb6b600c09001b28110c76b');
cart.setVariable(item, 'business_justification', 'aaa');
gs.info('Junk - Placing Order');
var rc = cart.placeOrder();
gs.info('Junk - rc.number = ' + rc.number);

1 ACCEPTED SOLUTION

jonmulherin
Giga Expert

We did not upgrade to Paris.  We've upgraded from Orlando to Quebec.

Received a response from SN Support.

From Paris, if you want to allow the Guest user (an unauthenticated user) to use the Cart api to create a catalog request, you need to make the catalog item available for any user by adding a User Criteria record with no-restrictions.

Add the "Available for" -- "Any User". OR
If you don't want to select "Any User" from the pre populated list in the "Available For", then you can click on the "New" (Instead of Edit) and create a custom list of the user criteria to whom you want to give access to the catalog item. OR
You can click on Edit and add user criteria that match the current user who is placing the order.

Please note that emails from external users that have no User[sys_user] record on the system (e.g. @gmail.com where there is no User record with Email=@gmail.com) are processed as the instance's internal guest user. For this workaround to work for the guest user you need to have a User Criteria that has no restrictions, such as the out-of-box Any User User Criteria. Any Catalog Items that can be ordered by external (i.e guest) users need to be under Available For Catalog Items on that unrestricted User Criteria.

View solution in original post

7 REPLIES 7

Thanks @Prasad Pagar and @jonmulherin  for sharing this information.

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

@Prasad Pagar 

Thank you.

Members have faced this issue in past when they upgraded to Paris instance. Seems ServiceNow didn't fix that but has provided workaround for using that User Criteria.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @jonmulherin,

I am facing similar issue, emails are sending from external email ID to servicenow instance, should generate service request using cart API, but its not happening.

So, over catalog item, I added Available for -Any user, but still emails from external ID are not being received to ServiceNow Instance. Kindly guide any thing I was missing here.