Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Redirecting from HR Workspace to HR Agent Workspace

Swathi Sree
Tera Contributor

Hi,

 

We have a requirement to redirect the user to HR Agent Workspace from HR Workspace

 

We have configured a UI Script with the below code but its not working.

 

(function() {

     if (window.location.pathname.includes('now/workspace/hr/home')) {

     window.location.replace('/now/hr/agent/home');
    } else {
      return;
    }
   
})();
 
Any help on this topic is much appreciated.
 
Thanks in advance.

 

 

 

1 ACCEPTED SOLUTION

@Swathi Sree 

sorry but you didn't create as per what I shared and hence it must not be working

check the image I shared above, sharing again here

AnkurBawiskar_0-1771418912425.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

11 REPLIES 11

Ankur Bawiskar
Tera Patron

@Swathi Sree 

try this UI script

How to Disable Agent Workspace After Migrating to Service Operations Workspace (SOW) 

addLoadEvent(function() {

    if (document.URL.indexOf('workspace/hr') != -1) {
        window.location = '/now/hr/agent/home';
    } else {
        return;
    }

});

AnkurBawiskar_0-1771411320563.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar ,

 

Not working

@Swathi Sree 

share your UI script config screenshot.

it should work fine, if you gave correct URL for old workspace

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

Please find the screen shot below

SwathiSree_0-1771418763855.png