ere’s a UI macro that I’ve used for a couple of clients that allows you to pop open an on-call rotation schedule for the group selected in any ‘Group’ reference field in the system. This will probably be most useful for the ‘Assignment group’ table that you use on the task table. As with any reference field UI macro, you can add the UI macro to your reference field by adding the ‘ref_contributions’ attribute to the dictionary entry of your reference field. So this macro would require the ‘ref_contributions=show_group_on_call_schedule’ attribute. Since it displays on-call information, it is also dependent on the ‘on_call scheduling’ plugin being installed.


Here’s the code you’ll need for your UI macro. This code should work without modification for any group reference field in your system.

‘show_group_on_call_schedule’ UI Macro
Name: show_group_on_call_schedule
Description: Displays an on-call schedule for the selected assignment group.
Requires ‘ref_contributions=show_group_on_call_schedule’ dictionary attribute.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" />
<j:set var="jvar_n" value="show_on_call_${jvar_guid}:${ref}"/>
<span id="${jvar_n}" onclick="showOnCallSchedule('${ref}')" title="${gs.getMessage('Show group on-call schedule')}" alt="${gs.getMessage('Show group on-call schedule')}" tabindex="0" class="btn btn-default icon-date-time">
   <span class="sr-only">${gs.getMessage('Show group on-call schedule')}</span>
function showOnCallSchedule(reference){
   //Get the current group
   var group = g_form.getValue(reference.split('.')[1]);
   //Query to see if an on-Call rotation exists
   var grpRota = new GlideRecord('cmn_rota');
   grpRota.addQuery('group', group);
   grpRota.addQuery('active', true);
      //Construct a URL for the popup window
      var url = 'show_schedule.do?sysparm_type=roster$[AMP]sysparm_zoom=weekly$[AMP]sysparm_group_id=' + group;
      //Open the popup
      alert('No active rotation specified for the selected group.');