- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 03:33 PM
Hello,
When I enter my script include into a report, the sysID is returning null.
What would be the reason for this? Below is my script include:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 10:16 PM - edited 03-07-2024 10:18 PM
Hi @TerryC03 tested in my PDI, works fine now. Follow the below steps
1. Create a client callable script include like below
in your report use in condition like this
sysid ISONE OF javascript: new scriptincludename().latestSprint()
result:
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:16 PM
Hi @TerryC03 replace the below code to your function
latestSprint: function(){
var sprintID;
var answer = []; // since you want more than 1 record use array to push values
var gr = new GlideRecord('sn_safe_sprint');
gr.setLimit(3);
gr.orderByDesc('sys_updated_on');
gr.query();
while(gr.next()){
answer.push(gr.getValue('sys_id'));
}
sprintID = answer.join(',');
gs.info(sprintID);
return sprintID;
},
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:22 PM
Ok. I did that and it did not work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:26 PM
Hi @TerryC03 what did it print in logs? also what is your requirement?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:33 PM
My requirement is to create a report that calculates the average of the 3 latest completed sprints' completed points. I'm thinking to just populate three records at a time for the report.
The logs are still printing "sprintUtil" is not defined.
Could the issue be how I'm calling the script?
I'm also switching back and forth between client callable. Thank you for your help with this issue so far.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 10:16 PM - edited 03-07-2024 10:18 PM
Hi @TerryC03 tested in my PDI, works fine now. Follow the below steps
1. Create a client callable script include like below
in your report use in condition like this
sysid ISONE OF javascript: new scriptincludename().latestSprint()
result:
Harish