Unable to call script include in report

Priyanka145
Tera Contributor

Hi All,

I m having a script include to return the group members of assignment group, and below is the script.

I need to call in the report and trying like below but not working. Please guide in how to call script include in report

 

getSDgroupmembers: function()
{
var members = [];
var SDeskDK = gs.getProperty('ServiceDeskRemote');
var grmebr = new GlideRecord('sys_user_grmember');
grmebr.addQuery('group',SDeskDK);
grmebr.query();
while(grmebr.next())
{
members.push(grmebr.user.getDisplayValue());
}
return members;
},

type: 'ServiceDeskGroupMembers'

 

 

In the report, it is called as below and report is on incident metric table.

 

Value is javascript:new ServiceDeskGroupMembers().getSDgroupmembers() AND

Definition is Assigned to duration

 

1 ACCEPTED SOLUTION

Ahmmed Ali
Giga Sage

Hello @Priyanka145 

 

* Is the script include client callable? SI should be client callable to be used in condition builder.

 

* script update: 

return members.join(",");

 

* Try updating condition as 

Value is one of javascript:new ServiceDeskGroupMembers().getSDgroupmembers() AND

Definition is Assigned to duration

 

Also run below script in background script and check if you are able to get the details as expected.

gs.print(new ServiceDeskGroupMembers().getSDgroupmembers());

View solution in original post

8 REPLIES 8

sushantmalsure
Mega Sage

Can you please share the screenshot of report? Need to see how are you using it in filters.

 

Ahmmed Ali
Giga Sage

Hello @Priyanka145 

 

* Is the script include client callable? SI should be client callable to be used in condition builder.

 

* script update: 

return members.join(",");

 

* Try updating condition as 

Value is one of javascript:new ServiceDeskGroupMembers().getSDgroupmembers() AND

Definition is Assigned to duration

 

Also run below script in background script and check if you are able to get the details as expected.

gs.print(new ServiceDeskGroupMembers().getSDgroupmembers());

Hi @Ahmmedali 

The same script include when I tried in background script, it has returned the members of the group 

 

Over the report I tried modifying as you suggested and also updated the script return members.join(","); . But it didnt work.

 

Client callable is checked

can you please share the screenshot of report showing how you are using it?