Cart API Query - Integration failing between two instances

maheshwarp75
Tera Contributor

I am working on an integration between two ServiceNow instances and using the following Cart script to manage this integration (using a custom remote table, transform map and script)

var item = cart.addItem(userReqId,1); //sys_id of Default Service Request of respective domain
// var item = cart.addItem('a4a098138788b510453b06xxxbb3520'); //sys_id of Global Service Request
// cart.setVariable(item, 'u_requester', userName);
cart.setVariable(item,'u_item', userReqId);
cart.setVariable(item, 'short_desc', source.u_short_description);
cart.setVariable(item, 'req_desc', source.u_description);
var rc = cart.placeOrder();

Instance A is non-domain separated instance with multiple customers interacting through their individual service portals to get IT support.

Instance B is a domain separated environment with 4 customers having their dedicated domains.

When a RITM gets created in Instance B which needed to be integrated to Instance A, using the OOTB Cart API, I am able to integrate the ticket and furthermore all updates happen through various custom flows appropriately.

But when I am trying to integrate RITM created in Instance A for a specific customer who is having a dedicated domain in Instance B, the integration fails because of the missing domain in the original request created in Instance A.

System logs captures the following error:

com.glideapp.servicecatalog.exceptions.CartException: Your cart has item(s) belonging to the 'ABC Company' domain. Please change the domain to continue with the checkout.: org.mozilla.javascript.JavaScriptException: com.glideapp.servicecatalog.exceptions.CartException: Your cart has item(s) belonging to the 'ABC Company' domain. Please change the domain to continue with the checkout.:

 

In Cart script, instead of passing the sys_id of the catalog item, I am querying the generic request sys_id from respective domains and passing it on to the script as a variable.

Not sure what am I doing wrong or how should I approach on this issue to resolve the domain exception error.

Just to mention, Request is being created in the correct domain, but the RITM and/or TASKs goes missing

0 REPLIES 0