advanced view rules

RudhraKAM
Tera Guru

can we use both condition and check the logged in users role in the advanced view rules ?

as we cannot use the current element in the view rules 

how do we check condition (where open RITM is from software catalog ) and logged in user has itil role then go to ess view.

 

can some one help me with this 

1 ACCEPTED SOLUTION

ChrisBurks
Mega Sage

If you need to check the user's role then you have to use the advanced script. In your other post I showed how to get both with an advanced script:

https://community.servicenow.com/community?id=community_question&sys_id=63545a6bdbbe6700d6a102d5ca961937

But also from your other post you mention to check against a Portal page as well. The view rules won't work if you're viewing a record using a "ticket" page because the ticket page doesn't direct pull in the "form" directly. Although, you can set the "view" it can use via the url it's pulling that from the url and then setting that view in the server script. 
Viewing a record with the "form" page is made more in line with the platform view and will execute view rules. Thus in order to use the actual "view rules" setup with portal you'll need to view the RITM using the form page or a page using the form widget.

View solution in original post

17 REPLIES 17

ChrisBurks
Mega Sage

If you need to check the user's role then you have to use the advanced script. In your other post I showed how to get both with an advanced script:

https://community.servicenow.com/community?id=community_question&sys_id=63545a6bdbbe6700d6a102d5ca961937

But also from your other post you mention to check against a Portal page as well. The view rules won't work if you're viewing a record using a "ticket" page because the ticket page doesn't direct pull in the "form" directly. Although, you can set the "view" it can use via the url it's pulling that from the url and then setting that view in the server script. 
Viewing a record with the "form" page is made more in line with the platform view and will execute view rules. Thus in order to use the actual "view rules" setup with portal you'll need to view the RITM using the form page or a page using the form widget.

Thanks Chris for the reply. 

Is there any thing I need to change in the below solution ?

find_real_file.png

RudhraKAM
Tera Guru

Thanks Chris for the reply , i just made some changes , and added logs but it seems not to be triggering , instead of answer i replaced it with view and its not working and i also checked by using answer too but not working 

 

find_real_file.png

Would you mind giving a little more details?

When you say "It's not working" what does that exactly mean? No logging coming out? 

What's the url you're using, (you can leave off the instance name if you need to)? 

Are you getting errors? Is it not working platform side or portal or both?