- 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 08:14 PM
This did not work. I'm still getting null sys ID.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 08:23 PM
HI @TerryC03 can you share your latest script include?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 08:30 PM
Sure.
var sprintUil = Class.create();
sprintUtil.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
latestSprint: function(){
var sprintID;
var gr = new GlideRecord('sn_safe_sprint');
gr.setLimit(3);
gr.orderByDesc('sys_updated_on');
gr.query();
while(gr.next()){
sprintID = gr.sys_id;
gs.info(gr.getValue(sprintID));
}
return sprintID;
},
type: 'sprintUtil'
});
There's a warning in the log stating: "sprintUtil" is not defined ==>new sprintUtil().latestSprint()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:05 PM
Hi @TerryC03 here is the updated code. tested in background script
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);
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:12 PM
Should I remove everything else in the script include and just place this code there? I need to use the latest updated records for a report.