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

vishwajeet5550
Mega Guru

Use Client Scripts for the Platform UI

function onLoad() {
    if (gs.hasRole('itil')) {
        g_form.setVisible('category', true);
    } else {
        g_form.setVisible('category', false);
    }
}

Hide Categories in the Service Portal Using Widget Configuration

function hideCategoryField() {
    if (window.location.pathname.includes('sp')) { 
        document.querySelector('[data-field-name="category"]').style.display = 'none';
    }
}
hideCategoryField();

 

Log in as an ITIL user on the platform and ensure categories are visible.

Log in as a Service Portal user and confirm the categories are hidden.

Hi @vishwajeet5550 ,

 

This are the incident category that  is created by Record Producer how should i code that.