Issue: Dynamic Script condition in SLA filter value

Muhammad Salar
Giga Sage
        gs.info('[GetExcludedServices] Started');

        var prop = gs.getProperty('custom.excluded.services', '');
        gs.info('[GetExcludedServices] Property value: ' + prop);
      
        //var formatted = 'sys_id1,sys_id2';
        var formatted = prop.replace(/\s+/g, '');
        gs.info('[GetExcludedServices] Returning formatted value: ' + formatted);
        return formatted;

using this script include function in sla filter value (service.sys id is one of), when i am using manually var formatted = 'sys_id1,sys_id2'; it is working fine and when i am getting this from property, it's not working, any suggestions????
property value is same: sys_id1,sysid2
1 ACCEPTED SOLUTION

@Muhammad Salar 

gs.getProperty() has some issues when called from client callable script include

use GlideRecord to query sys_properties table with your name of property and then return the value

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

10 REPLIES 10

@Muhammad Salar 

not very sure on that part as NOT IN is not available

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