Default query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 10:32 PM - edited 01-03-2024 10:44 PM
Hi all,
Pls help
Add Business rule to the “Service” cmdb table. This will run on query, and if the 'operational_status' field is not included in the query, add operational_status = operational
Update the rule so it also checks that sys_id is not already in the query.
when looking at Services from a list view, if you group them by Operational Status this rule always seems to run (and thus only displays Services marked as operational). Please investigate.
Actually i have around 199 record.
This is my current script :
(function executeBeforeQuery(current, previous /*, g*/) {
var queryString = current.getEncodedQuery();
// Check if the query doesn't already include 'operational_status'
if (queryString.indexOf('operational_status') < 0) {
// If 'operational_status' condition is not part of the query, add it with '1' status
queryString += '^operational_status=1';
// Set the modified query back to the GlideRecord
current.addEncodedQuery(queryString);
}
})(current, previous);
Not working as expected please suggest what adjustments to to in current script