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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Cameron,

can you share the screenshot of the form where this is happening and also the script?

Regards

Ankur

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

SatheeshKumar
Kilo Sage

Try using Before query business rule to restrict records for specific users based on conditions , i think it will best suite for your case.

 

check below link for more details:

https://www.servicenowguru.com/scripting/business-rules-scripting/controlling-record-access-before-query-business-rules/

 

Check below BR for example:

search  "incident query" in your instance!!

 

-satheesh

Shillu
Kilo Guru

As the requirement is for limiting access to the RITM records (and the related SCTASK records) created from a specific catalog item, creating an ACL rule will be the best way to achieve this.

SanjivMeher
Kilo Patron
Kilo Patron

You can hide that particular related list using an onLoad script. Below link should help.

 

https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_GlideFormHideRelatedList_String


Please mark this response as correct or helpful if it assisted you with your question.