- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 06:28 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 06:37 AM
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());
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 08:23 AM
Hi @Priyanka145
Can you post screenshot of your script include and filter condition?
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 02:23 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 08:00 AM
@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:
Report Screenshot
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
If you have created the Script Include in ServiceNow version "Washington" and above make sure, you have checked the "Sandbox enabled" Checkbox. This will work.
Please mark my answer helpful if it helped you.
Regards
Pawan K Singh
