How can I see when an on-call schedule was last updated?

qwertyflop
Giga Guru

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?

2 REPLIES 2

qwertyflop
Giga Guru

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());
    }
}

 

 

Community Alums
Not applicable

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: 

  1. 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.
    AbhishekPande1_0-1727758787350.png

     

  2. 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