(function executeRule() {
var grCI = new GlideRecord('cmdb_ci');
grCI.addNotNullQuery('x_tori2_addm_key');
grCI.query();
var dataStr =
'name,x_tori2_addm_key,sys_id,sys_class_name\n';
while (grCI.next()) {
dataStr += grCI.getValue('name') + ','
+ grCI.getValue('x_tori2_addm_key')
+ ','
+ grCI.getUniqueValue() + ','
+ grCI.getValue('sys_class_name') + '\n';
}
var user = new GlideRecord('sys_user');
user.get(gs.getUserID());
var gsa = new GlideSysAttachment();
gsa.write(user, 'uControl.csv', 'text/csv', dataStr);
})();
Comments
Post a Comment