- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2025 03:17 PM
I have a custom URL that directs to instance for all users. I have created a business rule to check the user role and direct them to Service portal if the user does not have ITIL role but it's not working. Is there a better way to redirect non-ITIL role user to the service portal and itil role user to the Instance.
(function executeRule(current, gForm, gScripting) {
var itilUser = gs.hasRole('itil');
if (itilUser) {
gs.getSession().setRedirect('/home.do');
} else {
gs.getSession().setRedirect('/sp?id=***')
}
})();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2025 08:43 PM
business rule is not recommended.
you will have to make changes to script include SPEntryPage and function getFirstPageURL and some system properties
check these links
6 ways to set up your Service Portal for redirection SUCCESS!
How to configure redirection for Service Portal
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2025 08:43 PM
business rule is not recommended.
you will have to make changes to script include SPEntryPage and function getFirstPageURL and some system properties
check these links
6 ways to set up your Service Portal for redirection SUCCESS!
How to configure redirection for Service Portal
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2025 08:33 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader