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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

@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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar The same script also didn't work

 

SwathiSree_0-1771419360734.png

 

@Ankur Bawiskar  Thank you so much for the response. It did work.

Tanushree Maiti
Mega Sage

Hi Swathi Sree

 

Under your script , add this one

 if (window.location.href.includes('your_old_hr_workspace_url')) {
      top.window.location = "/now/hr/agent/home"; // The URL of the new HR Agent Workspace   }

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

@Tanushree Maiti  Its not working

SwathiSree_1-1771418786130.png