UI Script works in Dev but not executing in Prod

JLeong
Mega Sage

The script below works in Dev but for some reason is not executing when I moved it to Production. What am I missing?

 

(function() {

    //alert('click ok');
    var ECpilotUser = new GlideAjax('global.getUserInfo');
    ECpilotUser.addParam('sysparm_name', 'getUserRole');
    ECpilotUser.getXMLAnswer(portalRedirect)

})();

function portalRedirect(response) {
    var pilotUser = response;
    if(pilotUser=='true') {
        var path = window.location;
        //alert('path = ' + path);
        var newpath = path.toString().replace("/sp", "/esc");
        //alert(newpath);
        window.location.assign(newpath);
    } else {
        return;
    }
}

 

9 REPLIES 9

@JLeong 

Go to Service Portal -> Portal in left navigation menu

Select the portal with URL suffix "sp"

Open theme record of the Portal and look for JS includes related list. Compare with your DEV or UAT, if any scripts are missing there.

 

Ankur Bawiskar
Tera Patron
Tera Patron

@JLeong 

Did it work fine in UAT when you migrated from DEV?

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

Hi Ankur,

It worked during our live testing.

@JLeong 

then it should work ideally.

Unless you replicate in lower instances you can't debug and identify the root cause

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks Ankur for your response.

I have opened a case with ServiceNow.