how to call system properties in Script include

rajasekar reddy
Tera Contributor

Hi All, 

 

I have a requirement, 

 

I have created 3 new system properties and stored sys_id's of catalog item in each. I am trying to call the property from script include it is not working. Here my script. Can any one help on this.

var getcyberapproval = Class.create();
getcyberapproval.prototype = {
    getRITMSysId: function() {
        var software = gs.getProperty('software.onboarding.item');
        var nonSoftware = gs.getProperty('non.catalog.software.item');
        var group = gs.getProperty('cyber.security.group');

        var sys_ids = '';
        var ri = new GlideRecord('sysapproval_approver');
        ri.addEncodedQuery('sysapproval.ref_sc_req_item.cat_item='+software+'^ORsysapproval.ref_sc_req_item.cat_item='+nonSoftware+'^group.assignment_group='+group+'^state=requested');
        ri.query();
        while (ri.next()) {
            sys_ids += ri.sysapproval + ',';
        }
        return sys_ids;
    },

    type: 'getcyberapproval'
};

 @Ankur Bawiskar  please help me on this script

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@rajasekar reddy 

query looks fine

Did you check by adding the query 1 by 1?

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

Hi @Ankur Bawiskar 

Hi ankur I check by adding the query 1 by 1 stile its not working. I have created sys properties as below screenshot, Please check is it fine de we need any changes

rajasekarreddy_1-1689680146610.png

rajasekarreddy_2-1689680211063.png

 

rajasekarreddy_0-1689680034456.png

 

@rajasekar reddy 

are you sure getproperty is giving you the values?

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

@Ankur Bawiskar 

No i am not sure, can you suggest.