- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 06:59 AM
Hi All,
I have created a system properties "a_b_c" where i have stored three sys ids of a catalog in form of a,b,c.
now this i have to use in business rule. when my catalog is any of this (a or b or c). then do xyz.
i have to put this sys property a_b_c in Encoded Query of a BR.
i have used but its not selecting that three catalog ids.
script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 05:44 PM
Hi @PawanKumarR
Try below script..
var sysIds = gs.getProperty('a_b_c').toString();
var encodedQuery = 'cat_itemIN' + sysIds;
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addQuery("opened_by", current.getValue('u_owner_id'));
ritmGr.addEncodedQuery(encodedQuery);
ritmGr.addActiveQuery();
ritmGr.query();
while (ritmGr.next()) {
//YOUR LOGIC HERE
}
Hope this helps .
Regards,
Siva

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 10:43 AM
Hi,
I tested this code before posting, so I've validated it does work. "not working" is really hard to support, as it gives us no indication of what debugging you've done. It's also helpful to post the updated script; and maybe even the content of your system property.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 01:10 PM
Apologies.
I written same as you suggested but still same, it would be great if u edit in my code.
Tried with above too but not working. below is the full code.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 08:28 PM
You can simplify this to a single GlideRecord query
function updateWorkflowStatus() {
var sysIds = gs.getProperty('a_b_c', '');
var sctaskGr = new GlideRecord('sc_task');
sctaskGr.addQuery("request_item", ritmGr.getUniqueValue());
sctaskGr.addQuery("order", 100);
sctaskGr.addQuery('cat_item', 'IN', sysIds);
sctaskGr.addQuery('request_item.opened_by', current.getValue('u_owner_id'));
sctaskGr.addActiveQuery();
sctaskGr.setLimit(1);
sctaskGr.query();
gs.info('#DEBUG Logic: Query: ' + sctaskGr.getEncodedQuery() + ' \n and found: ' + sctaskGr.hasNext());
if (sctaskGr.next()) {
new Workflow().broadcastEventToCurrentsContexts(sctaskGr, 'update', null);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 12:28 PM
Hi Kieran, thanks for your script. i did same but worked for only one catalog, not for other two.
Can we do something to make it any one of three catalog then run script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 04:53 AM
It'll work for as many items you have in the system property, as long as they are comma seperated