Restrict dropdown values in list view for incident

Tharun15
Tera Contributor

Hi All,

how we can restrict dropdown values in the list view

Table: Incident

Field: State

Field value ‘Closed’ should be visible only for Admin user in both form view and list view (In form view, this is already in place, need to do it in list view as well).

 

Regards,

Tharun

1 ACCEPTED SOLUTION

Hi,

So only admins should be able to change State to closed

update BR condition as this

current.state == 7 && !gs.hasRole('admin')

Regards
Ankur

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

View solution in original post

14 REPLIES 14

Hi,

you can also use before update BR

Condition: current.state == 'closed' && !gs.hasRole('admin')

Script:

(function executeRule(current, previous /*null when async*/) {

    // Add your code here

gs.addErrorMessage('You are not admin so cannot set state to closed');

current.setAbortAction(true);

})(current, previous);

Regards
Ankur

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

Hi Ankur,

This BR Not working. for other ITIL roles(with out admin).

 

please find the below BR.

 

find_real_file.png

Hi,

So only admins should be able to change State to closed

update BR condition as this

current.state == 7 && !gs.hasRole('admin')

Regards
Ankur

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

Hi Ankur,

 

How to hide the value ‘Closed’ from the choice list.

 

Regards,

Tharunkumar A

Hi,

I could see you marked my response as correct earlier and now it is not.

If my response helped you please mark it correct

Regards
Ankur

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