User logging through Service Portal should not see few categories in incident form.

ShiningStar1
Tera Contributor

Hello All,

 

We have got a requirement that only ITIL users will be able to see all the categories in incident form but it should be invisble for users logging through service portal. Kindly help in acheiving this.

 

Already wrote client script but it did not work .Any help please.

11 REPLIES 11

@ShiningStar1 

you will have to add user criteria for all the catalog items under those 4 categories

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Thank you for your reply.But its not categories from Catalog Items .Its the category available in the incident form . Can you please help.

@ShiningStar1 

you can use onLoad catalog client script and check logged in user's role and use g_form.removeOption() for incident form

Also check by checking the URL if it's portal

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@ShiningStar1 

something like this in onLoad catalog client script, Applies to - ALL

function onLoad() {
    var url = top.window.location;
	// give portal name here
	// if it's portal and role is not itil then remove the options
    if (url.indexOf('/sp') > -1 && !g_user.hasRole('itil')) {
        g_form.removeOption('category', 'categoryChoiceValue1');
        g_form.removeOption('category', 'categoryChoiceValue2');
    }
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@ShiningStar1 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader