On-Call Schedule Dashboard

BHunt
Kilo Contributor

We recently implemented the On-Call Rotation application in our instance to replace the a spreadsheet that was kept by the IT managers on SharePoint.   At first everyone loved the idea of an automated on-call rotation and that it would be available in the cloud for easier access.   Shortly after being rolled out though the management team realized they would need to pull the Rotation Schedule Report each time they wanted to see who was on-call.   As a solution to making this easier it was suggested that a Dashboard be created for all On-Call groups for the current week.   This sounded 'tall good and easy, until I went to look into it and realized that the Rotation Schedule Report isn't a normal report, but a UI Page that generates the report on the fly.   From what I can tell the report is generated based off of the v_rotation table which is only populated from that UI Page.

Has anyone come across this or can help me figure out how to create a dashboard to replace having to generate the report using the UI Page?   It just needs to be the current week and all the On-Call groups?

10 REPLIES 10

Thank you for this Maurie and Jon!



I've attempted to do this as well but I'm seeing a few things, and I wondered if you came across them as well.



First, if I append a comma-separated list of sys_id's for the groups I'd like to see on the schedule (there are 25) I only see one of them in the resulting table (happens to be the 2nd sys_id in the list).



Second, while I am able to see that report, if I impersonate a non-admin user I get the blank page with the Print option.



Any of this sound familiar?


The securities are set to only allow for Managers of the group, System Admins or Rota Admins to view all the calendars.   We had to set up a special role to compensate for this.



Give me a bit and i will dig for the code that we used to fix this.



--Maurie


Below is the suggestion that ServiceNow gave me.   once i add the role of oncall_formatted_schedule_user and added it to the ITIL role, all ITIL users could view all calendars.



2014-09-12 15:03:05 - Rich Dawes (NOW)Additional comments
Solution proposed by Rich Dawes (NOW)


Hi, Maurie!


I have scoped out the Formatted Schedule report, to the point that I think that, with the information I can provide,
either your needs will be met, or you'll know where to explore and develop further if your needs require it.


The Schedule Report module brings up a UI Page, on_call_schedule_report, which when submitting with the
Formatted report style option, calls up another UI Page, schedule_formatted_report:


https://uamsdev.service-now.com/sys_ui_page.do?sys_id=e545b2129f321100d8f8700c267fcff5


That provides some Jelly wrapping and style elements, for handling the functionality coded in a Script Include,
with Javascript class, FormattedScheduleReport:


https://uamsdev.service-now.com/sys_script_include.do?sys_id=277ca4139f231100d8f8700c267fcf56


Whatever groups were selected originally are passed through into this script, an are allowed or whittled down with
function getPermittedGroups(). Assuming that High Security is enabled (it is), each group is examined individually
by passing it to OnCallSecurityNG.rotaAccess(), defined in another Script include for class OnCallSecurityNG:


https://uamsdev.service-now.com/sys_script_include.do?sys_id=3f8d56170a0a2c9660fe6df53700fe08


The latter set of functions is where On-Call security is implemented, which is largely dependent on roles.


Having outlined all that, the key to returning more than only a user's own group's schedule(s) will be found,
ultimately, by affecting what group list (comma-separated sys_id's) is returned by getPermittedGroups(). You
could venture into OnCallSecurityNG, which seems like the place to augment functionality if your needs turn
out to be on the more complex side. The class definition is kind enough to provide some infrastructure for
extension and debugging.


A simple approach -- which would side step affecting On-Call / Rota functionality otherwise -- could be to create
and assign a special role and check for it in getPermittedGroups(). If your goal is to allow certain users to have
access to the formatted schedule report for -all- On-Call group rotas, you could augment the first conditional
statement like so:


if (!pm.isRegistered("com.glide.high_security") || gs.hasRole('oncall_formatted_schedule_user'))
return commaSeparatedGroups;


That's just a suggestion; your actual solution (which you must implement) depends on your needs.


The other issue that you mentioned was the heading for the groups column. That is defined in function getHTML() of
the FormattedScheduleReport script include, at about line 370. You could, for instance, edit the assignment to the
"header" variable like so:


header = "<th align='center'>On-Call Schedule(s)</th><th align='center'>Roster</th><th align='center'>Shift</th>";


I hope the above information is helpful, Maurie. I certainly appreciate your patience as I took time to gather it. Please
also note that I am tagging this incident as resolved. It's still open, however, and I invite you to call me or update it with
any follow-up questions or thoughts you may have. Of course, if you have none, I request that you Accept Solution at
your next opportunity when in HI. Thanks!


Best wishes,


-Rich



Rich Dawes | Technical Associate Developer
ServiceNow | Transform IT
+1 (858) 876-6948 - Direct
+1 (858) 345-1444 - Main line
(800) 866-4234 - US toll-free

Thank you Maurie, and Rich too!



Good stuff. I really appreciate it.


mrswann
Kilo Guru

This is helpful but I think the On-Call functionality should do a bit more straight OOB.




This thread is quite old but I am not aware of any significant changes in that time... our users just want to know quickly:



1) who is on call


2) what their contact details are