- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 04:13 AM
Hi team,
I have around 43 different sys_id's , for those need to trigger one Business Rule.
i have created one system property and given the sys_id in the value . and written one BR its working fine.
But i have around 43 different sys_id's need to execute the same BR, if i put more than one sys_id in the value of system property, its not working, please suggest how can i proceed.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 04:21 AM
Hi @Abhilasha G T
Please try this
In the property, put the SysId values with comma separator, something like this b7d2659197b5311025e49fa00153afce,b7d2659197b5311025e49fa00153afce
In the script, please use this in line 7: wo.addQuery('template', 'IN', gs.getProperty(" your property name"));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 04:24 AM
1. First you can put different sys_id's in as comma (,) separated list
e.g., alksdje28eyhdj893,hdgiuwe12ewf8
2. In your code use below query
wo.addEncodedQuery('parent=' + current.sys_id + '^templateIN' + gs.getProperty('your_property_name'));
or
In case above query does not work, use below :
wo.addEncodedQuery('parent=' + current.sys_id + '^templateIN' + gs.getProperty('your_property_name').toString());
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates