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

Hi @Priyanka145 

 

Can you post screenshot of your script include and filter condition?

 

Thanks,

Ali

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

Thank you,
Ali

Hi @Ahmmed Ali 

The script worked well now, im able to call the script include in report the way you have told by adding join in  the script. 

sushantmalsure
Mega Sage
Mega Sage

@Priyanka145 I have tried something similar and it worked for me on my PDI.

Only thing I have done is from script include i have returned 'return members.join();'

SI screenshot:

sushantmalsure_1-1680793221451.png

 

Report Screenshot

 

sushantmalsure_0-1680793114659.png

 

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