Redirect Users with no/any role apart from 'admin' & 'itil' to Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-17-2020 01:02 PM
Hi,
I am trying to redirect users with any roles apart from 'itil' to Service Portal (/sp). This works upon initial login if user has no roles & users with no roles can not access the platform/backend view even if they hit the base URL (https:/instance-name.service-now.com or https:/instance-name.service-now.com/navpage.do) they get redirected to Portal.
If an user with any role such as approver_user or custom roles tries to login. They get the Portal Login page but post login get redirected to Platform View (/navpage.do).
I have done the below as per the documentation.
System Properties:
- glide.entry.first.page.script value is set to new SPEntryPage().getFirstPageURL()
- glide.entry.loggedin.page_ess is set to /sp
- glide.entry.page.script is set to new SPEntryPage().getLoginURL()
Script Include:
Update the Portal suffix in Script Include 'SPEntryPage' to /sp
this.portal = "/sp/";
I have tried to modify the 'SPEntryPage' Script Include to check for 'itil' role as below but with no success & users still get into the Platform view.
if (user.hasRoles("itil") && !redirectURL && !isServicePortalURL)
return;
I have tried to go through a few questions on communities but I am unable to figure out how to redirect all users with no roles & users with non itil role to Portal.
Please Suggest. Thanks
- Labels:
-
Service Desk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-17-2020 02:35 PM
HI,
OOB if you have approver_user role you can navigate to backend. If you want to restrict that then you need to handle that in script include.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-17-2020 02:46 PM
Hi Ashutosh,
The Script Include you are refering to is 'SPEntryPage' or a different one?
I have tried to make changes to 'SPEntryPage' as below but that doesn't help. My understanding is that will allow users who have admin & itil roles to go directly to Platform UI, all others role users will be redirected to the Service Portal.
Let me know if you had any luck with it. Thanks
if (user.hasRoles("itil") && !redirectURL && !isServicePortalURL)
return;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-02-2025 06:32 AM
Hi,
Did you find a solution for this?
Thanks,
Vinod