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
Mega 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());

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

7 REPLIES 7

sushantmalsure
Mega Sage
Mega Sage

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

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Ahmmed Ali
Mega 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());

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

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?

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure