How to check if the user opens the RITM from portal or regular view.

RudhraKAM
Tera Guru

Hello , there 

 

I have a requirement where I need to check if the user opened RITM in regular fuillfiler view or portal view , how to get that ?

My task is to create a view rule using script , and to check if the user has ITIL role and is the user opening the RITM frm portal or regular view 

2 REPLIES 2

sachin_namjoshi
Kilo Patron
Kilo Patron

You could determine this based on the url;  (gs.getUrlOnStack)

 

Regards,

Sachin

Thanks for the reply Sachin..

Can you  help me with this  how to add the query to check if that is portal url or not.

 If the user opening an RITM has no itil roles, and the requested item is from the Software Catalog, and the item is being opened from an /xyz portal url and the item is not closed incomplete, use the sp view.

*/xyz is my portal 

My script :

if (!gs.hasRole("itil") && current.item.sc_catalogs=="57bf1d3e13635b00602dbcaf3244b0a0" && current.state!="4");
view =sp;