Is there a way to restrict RITM list view and related SCTASK (service catalog) tasks list views of a particular service catalog item to a group of users or based on role.

Kamran1
Kilo Guru

We have a service catalog item ABC, that generates RITM/SCTASK as any other OOB SC item would do.

Is there a way to hide RITM/SCTASK lists created as a result of submitting a request via cat item ABC. In other words we would like to restrict a group of users to be able to see RITM and SCTASK created under catalog item ABC.

I have tried hiding variables with a role with an onload script which works but the small preview i icon still shows them as well as users can still see RITM list.

Any help would be greatly appreciated.

Thanks,

Cam

 

 

 

 

 

1 ACCEPTED SOLUTION

Kamran1
Kilo Guru

I got it working. Just had the && condition needed instead of ||

 

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

if(gs.getUserID().hasRole('admin')!=true && gs.getUserID().hasRole('epic1')!=true) {

current.addQuery('cat_item.name','!=','Apple iPad 3');
}

})(current, previous);

View solution in original post

12 REPLIES 12

Kamran1
Kilo Guru

Thanks weikiat.g. I have BR on query action still didn't work.

 

Kamran1
Kilo Guru

I got it working. Just had the && condition needed instead of ||

 

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

if(gs.getUserID().hasRole('admin')!=true && gs.getUserID().hasRole('epic1')!=true) {

current.addQuery('cat_item.name','!=','Apple iPad 3');
}

})(current, previous);

Good to know u found the answer. If my previous useful for you. Maybe u can mark as helpful.