Loading...
Loading...
This is reproducible in London and Madrid. 1. Go to Maintain Items in a OOB. 2. Select the "Standard Laptop" catalog item 3. Create a Catalog Item Client Script Name: Test UI Type: All Applies on Requested Items: Selected Script: function onLoad() { var catalogItem = g_form.getValue('cat_item'); var reqItemID = g_form.getUniqueValue(); console.log('DEBUG 0 - catalogItem: ' + catalogItem); console.log('DEBUG 1 - reqItemID: ' + reqItemID); } 4. Go to Service Portal 5. Turn on developer console in the browser (F12) 6. Order a Standard Laptop and check out. 7. On the "Order Status" page, select the order item "Standard Laptop" 8. Change the URL from "ticket" to "form" https://<instance_name>.service-now.com/sp?id=ticket&table=sc_req_item&sys_id=0d4db305db303300619058b3ca96198d&view=sp to https://<instance_name>.service-now.com/sp?id=form&table=sc_req_item&sys_id=0d4db305db303300619058b3ca96198d&view=sp 9. Observe the console debug DEBUG 0 - catalogItem: <--- Is NULL, should be value of "Standard Laptop" catalog Item DEBUG 1 - reqItemID: 04b7e94b4f7b4200086eeed18110c7fd <---- Value of "Standard Laptop" catalog Item (Should be SYS ID of request item) 10. Open the same request item in ITIL frameset https://<instance_name>-now.com/nav_to.do?uri=%2Fcom.glideapp.servicecatalog_cat_item_view.do%3Fv%3D1%26sysparm_id%3D04b7e94b4f7b4200086eeed18110c7fd 11. Observe the console debug DEBUG 0 - catalogItem: 04b7e94b4f7b4200086eeed18110c7fd DEBUG 1 - reqItemID: 422eb34ddbb03300619058b3ca961974 (Display as expected)
For the platform behavior, kindly continue to use the same client script that you have in place as it is working fine. For Service Portal, please follow the steps below: ********************* 1 - Navigate to "sp_theme.list" in platform. 2 - Go to the portal theme which you are using 3 - Create a new JS include for this theme and add a new UI Script associated to it. 4 - Copy/Paste the following UI Script to Script field and submit it. UIScript: function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } 5 - Define the following catalog client script for ui type Mobile/ServicePortal Catalog client script: function onLoad() { var catalogItem = g_form.getUniqueValue(); var reqItemID = getUrlVars()["sys_id"]; console.log('DEBUG 0 - catalogItem: ' + catalogItem); console.log('DEBUG 1 - reqItemID: ' + reqItemID); } ********************* Please check attached screenshots for reference.
PRB1338805
Click on a version to see all relevant bugs
ServiceNow Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.