Issue in UI Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:57 AM
For the URL https://www.service-now.com/esc?id=index, the redirection is not working. Please refer to the updated script below:
(function() {
url = window.location.href;
if (url.includes("sp?id=index")) {
// Redirect SP index to ESC home
window.location.assign(url.replace("sp?id=index", "esc"));
} else if (url.includes("esc?id=index")) {
// Redirect ESC index to ESC home
window.location.assign(url.replace("esc?id=index", "esc"));
} else if (url.includes("sp?id=kb_view2")) {
// Redirect to ESC knowledge home
window.location.assign(url.replace("/sp?id=kb_view2", "/esc?id=esc_knowledge_home"));
} else if (url.includes("sp?id=landing")) {
// Redirect to ESC login page
window.location.assign(url.replace("/sp?id=landing", "/esc?id=login"));
} else if (url.includes("/kb?id=kb_article_view")) {
// Redirect KB articles to ESC
window.location.assign(url.replace("/kb", "/esc"));
} else {
// General redirection from SP to ESC
window.location.assign(url.replace("/sp", "/esc"));
}
})();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 10:38 AM
Are you trying to move from Service Portal to employee center? If so during a training I took it suggested changing the URL suffix. By going to Service Portal > Portals and then change the URL suffix for Service Portal to sp_old and then update employee center from esc to sp. This way it will be seamless to employees (no need to create new favorites) and if you have links setup in SharePoint sites you don't have to update them. You will also have to setup employee center as the default portal and remove that from service portal.