Create a report for RITMs closed on last working day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2025 11:49 PM
Hi All,
I need to create a report which should reflect all the RITM details ( list view ) 'closed' on the last working day.
Ex. If 'Friday' is the last working day then the report should show all those RITMs
It'll be great if someone could help me out
Thanks and Regards,
Saurabh Chatterjee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 02:22 AM
your script include should be client callable so that it can be called from report
Report filter condition
SysId [IS ONE OF] getTickets()
Refer below link and then once you get the date query on your table
How can I subtract time from a date? The Schedule class ignores negative durations.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 05:59 AM
Hi Ankur,
Thank you for your reply!
Can you please help me understand how to call the script include for the 'closed' field? I do not see any option to call the script include for this field
Regards,
Saurabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 06:13 AM
As already mentioned you should use filter condition as
SysId [IS ONE OF] javascript:getRecords()
The script include should be client callable
In that script include you should determine the closed date and then query
Something like this
function getRecords() {
// determine last working day before today as per Schedule logic
var arr = [];
var gr = new GlideRecord("tableName");
gr.addQuery("closed_at", yourValue);
gr.query();
while (gr.next()) {
arr.push(gr.getUniqueValue());
}
return arr.toString();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 06:15 AM
I believe I have provided enough help and guidance for your question.
Based on your developer skills you can enhance it further for your requirement.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 02:44 AM
Hi @Ankur Bawiskar ,
Indeed this has helped - just one last query. As you can see I have applied the logic but when I am testing the script include I am not able to see any 'logs' getting recorded i.e. once I am running the report, the script include is not getting called
Am I getting incorrect somewhere?
Regards,
Saurabh