gs.log()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 02:17 AM - edited ‎05-15-2023 02:18 AM
var checking_user_is_part_of_specific_Group = Class.create();
checking_user_is_part_of_specific_Group.prototype = {
initialize: function() {
},
isUserPartOfGroups: function(groupNames) {
var chg = new GlideRecord('change_request');
var user = new GlideRecord('sys_user');
var reqby = chg.getValue('requested_by');
var cond = user.get('name',reqby)
if (cond)
{
var userEmail = user.getValue('email');
for (var i = 0; i < groupNames.length; i++) {
var group = new GlideRecord('sys_user_group');
if (group.get('name', groupNames[i])) {
var groupHasUser = new GlideRecord('sys_user_grmember');
groupHasUser.addQuery('user',user.getValue('user_name'));
groupHasUser.addQuery('group', group.getValue('sys_id'));
groupHasUser.query();
if (groupHasUser.next()) {
gs.log (" Vignesha priya log checking" + userEmail);
}
else
{
gs.log (" Vignesha priya log checking - user is not part of the group");
}
}
}
}
gs.log (" Vignesha priya log checking - User is not in user table");
},
type: 'checking_user_is_part_of_specific_Group'
};
This is my script include. I need to check output of the script include. I am using gs.log(). May I know if the format is correct. Where can I check log statement. I am not finding it under System logs. I call this in change approval decision.
I try to check the condition by creating a change request with the highlighted condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 12:10 AM
Dear @Vignesha Priya
I apoligized, i used the wrong word as scope, correct is Source.
Yes.... gs.log('My incident number ' +gr.number , '4444');
Goto syslog.LIST, give source is 4444 (any value can possible) , it will give your logs in the syslog table.
- Kailas