- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 01:42 AM
I have written this script include :I want to add log message in this since this code is not working also were to checks the logs in service now
var Configuregroupbasedonassigned = Class.create();
Configuregroupbasedonassigned.prototype = {
initialize: function() {
},
getGrpMembers:function(u_ser)
{
//var GrpU= current.variables.u_assigned_to;
if(u_ser=="")
{
return;
}
var GrpMember= new GlideRecord('sys_user_grmember');
// gs.info(u_ser);
//gs.info(GrpMember);
GrpMember.addEncodedQuery('user='+u_ser);
// GrpMember.addEncodedQuery('group='+Grp);
// GrpMember.addQuery('user','Grp');
GrpMember.query();
var Groups = [];
while(GrpMember.next())
{
Groups.push(GrpMember.group.toString());
}
// gs.info(GrpMember);
return 'sys_idIN'+Groups.toString();
},
type: 'Configuregroupbasedonassigned'
};
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 01:58 AM
Hi Avinash,
if your script include is in Global scope you can use gs.log() to print log
if your script include is in Scoped scope you can use gs.info() , gs.warn() ,gs.error(), gs.debug( )to print log
ex. gs.log("Test log Script include");
Always try yo add unique text in log so that it will be easy to search
Also please refer below to check the logs ,Always try to sort by created to get latest logs
Thanks
Valmik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 01:49 AM
Hi
You can search for System log->ALL in application navigator.
Please Mark it as correct if its helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 01:58 AM
Hi Avinash,
if your script include is in Global scope you can use gs.log() to print log
if your script include is in Scoped scope you can use gs.info() , gs.warn() ,gs.error(), gs.debug( )to print log
ex. gs.log("Test log Script include");
Always try yo add unique text in log so that it will be easy to search
Also please refer below to check the logs ,Always try to sort by created to get latest logs
Thanks
Valmik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 02:05 AM
Hi,
you can add gs.info() and search in System Logs module
Can you share script include and client script are in same scope?
share screenshots for both
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader