How can I see when an on-call schedule was last updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2022 12:51 PM
I need to create a report showing on-call schedules that have not been updated in the last X number of days. How can I do this, either through reporting itself or via a script include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2022 02:14 PM - edited ‎12-05-2022 02:30 PM
I believe that this script should be capturing all of the groups that have an on-call schedule not updated in the past 7 days. Hoping someone can confirm...
var groups = [];
var ga = new GlideAggregate('cmn_rota');
ga.addAggregate('GROUP_CONCAT_DISTINCT', 'group'); // there are multiple shifts for each group. only get each group once.
ga.query();
while (ga.next()) {
var gdt = new GlideDateTime();
gdt.addDays(-7);
var gr = new GlideRecord('cmn_rota');
gr.addQuery('group', ga.group.sys_id.getValue());
gr.addQuery('sys_updated_on', '<', gdt.getValue()); // only get the shifts that have not been updated in the last 7 days
gr.orderByDesc('sys_updated_on'); // for each group get the most recently updated shift first
gr.query();
if(gr.next()) { // if instead of when so it only runs for the most recently updated shift
gs.info('Group: ' + gr.group.name.getValue() + ' --- Manager: ' + gr.group.manager.name.getValue());
gs.info(gr.sys_updated_on.getDisplayValue());
groups.push(gr.group.sys_id.getValue());
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 09:54 PM - edited ‎09-30-2024 10:00 PM
Hi @qwertyflop
Not sure if you are query is resolved based on earlier recommendation though additionally you can create a report from on below table get the information of last updated in X number of days
Table Name:
- Schedule [cmn_schedule]: Search by on-call name using 'Name' or 'Lable' field and apply filter ' Update > NOT ON > Last 7 Days' for example to get the data.
- Roaster [cmn_rota_roaster]: to get the roaster update information.
Additionally, you can check "Business Calendar [business_calendar_list]" table by applying required filter using "Name", "Lable" and 'Parent' field to get last updated information using On-call schedule names.
These will give you all information who scheduled and when scheduled.
Hope this have answered your query to close this thread.
Note: If you find this information helpful, please mark 'Helpful' or 'Correct' and accept the solution.
Regards
Abhishek Pandey