Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

set acl for multiple catalog items

Akki1
Tera Contributor

Hi,

I have a acl which I need for multiple catalog items but I don't want to use the hardcoded sys_id in condition.I have created a property with comma seperated sys_id of catalog items. How do I use in my script to apply the acl for only these catalog items?

12 REPLIES 12

it should be "cat_item"

 

var items = gs.getProperty('<property name>'); //property should hold comma separated sys_id of catalog items

var itemList = items.toString().split(',');

if(itemList.indexOf(current.cat_item) > -1){

    answer = true;

}

@Alex Pandian1 Thanks but can current object be used in acl?

 

@Akki1 Yes

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala