how to call system properties in Script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 02:28 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 02:31 AM
query looks fine
Did you check by adding the query 1 by 1?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 04:42 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 04:58 AM
are you sure getproperty is giving you the values?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 05:13 AM
@Ankur Bawiskar
No i am not sure, can you suggest.