Need to call script include in reporting.

Pragati4
Tera Contributor

Hi All

I have a requirement in which i want to get report of all the cases who's assignment group is part of "report group".

"report group" is a field which i have created in my user form in which we can add n number of groups.

 I know we can achieve this using script include then calling that function using java script but that is knot working i dont know why.

i have written below code but this is not working

var getGroup = Class.create();
getGroup.prototype = {
initialize: function() {
},
getreportgroup: function(){
var group ='';
var user = new GlideRecord('sys_user');
user.addQuery('sys_id',current.sys_id);
user.query();
while(user.next()){
group = user.u_report_group.toString();
}
group = 'sys_idIN' + group;
gs.log('testing'+ group);
return group;

},
type: 'getGroup'
};

11 REPLIES 11

Hi Pragati,

What does the log show?

Does it show list of sys_ids?

Also can you check whether the script include function itself is getting called or not?

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

No log entry is not there, I checked

Hi Pragati,

So it means the script include and the function itself is not getting called and hence sys_id array is not returned.

Can you share screenshot of how and where you are calling that?

Regards

Ankur

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

Hi Pragati,

Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.

Regards
Ankur

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

Hi Pragati,

Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.

Regards
Ankur

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