How to redirect users in ServiceNow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 04:46 PM
Hello,
I have a requirement to redirect users to different pages when the login. Currently this is not done through SSO, but Okta maybe used in the future. We are working with the Customer Service Management Plugin
I have a couple of cases
1) Contacts and Consumers logging in should be redirected to the "csm" portal
2) Agents should be redirected to Agent Workspace, but may need to navigate to UI16
3) Duty Managers and Admins should be redirected to UI16
My current solution involved adding the following lines of code to the getFirstPageURL function of the SPEntryPage script includes.
if(gs.hasRole('admin')|| gs.hasRole('u_back_end_viewer')){
return;
}
if(gs.hasRole('itil')){
return '/now/workspace/agent/home';
}
if(gs.hasRole('snc_external') && redirectURL){
return "/csm";
}
The role u_back_end_viewer has been created to give to duty managers and admins so that they're properly redirected.
This solution works, mostly, however under case (2) Agents can't navigate to UI16, even when using "/nav_to.do?uri=%2Fhome.do%3F" as it instead brings them back to the Agent Workspace. They can however navigate to the customer service portal using /csm.
I am looking for a modification that will handle redirection ONLY when the user logs in, so that Agents can still access UI16 through a different URL or provided link
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 06:51 AM
I know this is several years old but has anyone solved this ?