Redirecting user

Steve2000
Tera Contributor

Hello,

 

I used the docs regarding to "redirecting user to Service Portal"

I followed the instructions, but when I impersonate a user on my instance, it doesn´t redirect me to the ServicePortal site instead I´m landing on the SOW page. I can´t figure out why this happens.

 

I set the value in the sys_property glide.entry.first.page to new SPEntryPage().getFirstPageURL()

In the Script Include SPEntryPage I changed this.logVariables to "true"

 

If the impersonate user has no roles, he should be redirected to the SP, shouldn´t he?

 

1 ACCEPTED SOLUTION

Hi @Steve2000 ,

If you want  itil users to be redirected to portal then modified condition in script include "SPEntryPage" as below.

if (user.hasRoles() && !user.hasRole("itil") && !redirectURL && !isServicePortalURL)
            return;
 
Please mark my answer as helpful if you find this is helpful.

View solution in original post

11 REPLIES 11

Aniket Zepale
Tera Guru

Hi @Steve2000 ,

 

Make sure you added below properties,

1)glide.entry.first.page.script

Type - string

Value - new SPEntryPage().getFirstPageURL()

2)glide.entry.page.script

Type - string

Value - new SPEntryPage().getLoginURL()

 

I think this will work .

Thanks!

Please mark my answer as helpful if you find this is helpful.

@Aniket Zepale 

When I do this, the 'itil' user for example, will still be redirected to the SOW site.

 

@Prince Arora 

So I have to delete the first.page.script and only use the entry.page.script?

 

Hi @Steve2000 ,

If you want  itil users to be redirected to portal then modified condition in script include "SPEntryPage" as below.

if (user.hasRoles() && !user.hasRole("itil") && !redirectURL && !isServicePortalURL)
            return;
 
Please mark my answer as helpful if you find this is helpful.

Community Alums
Not applicable

Hi , i tried the below code suggested by you.

 

if (user.hasRoles() && !user.hasRole("itil") && !redirectURL && !isServicePortalURL)

return ;

 

it works for itil users to get the service portal page but for admin users also it is redirecting to sp page

 

how to achieve the below requirement . please guide me 

 

if user has no role then redirect to Service Portal page

If user has only role 1 'xxx'  then redirect to Service Portal page

If user has only role 2 'yyy' then redirect to Service Portal Page

 

If the user has any other role along with the above role then it shouldn't redirect to service portal page

 

Steve2000
Tera Contributor

Thank you very much, both of you 🙂 

Now it works 👍