How to redirect users in ServiceNow

Felix Fleming1
Giga Guru

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

10 REPLIES 10

preethichauhan7
Kilo Contributor

Hi , I  am facing the same issue .There is an requirement when the particular role user login it should redirect to agent workspace landing page .Is there any answer for this.

Not yet, we parked this to look at again in the future

Hello @Felix Fleming1 

Did you find any solution to your second query (Agents should be redirected to Agent Workspace, but may need to navigate to UI16). I am also facing the same problem. IF you find a solution, please can you share it with us!!

Thank you,

Shivprasad

Rachel Gomez
Giga Expert

In the filter navigator, type: sys_properties.list and press Enter.
Find the property: glide.entry.page.script and set the value to: new SPEntryPage().getLoginURL(), save your changes.
Go back to the sys_properties list, if the property glide. 
For the property name, enter: glide.entry.first.page.script.

 

Regards,

Rachel Gomez

Hello @Rachel Gomez 

When the ITIL user is logged in first, then user homepage should be look like this

This image is service operations workspace, but instead off that i need agent workspace

do you have any idea how to setup like this?

service opeartions view.png