- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2019 11:07 PM
Hi All,
On the on-call schedules page ($oc_groups), under "all on-call schedules" tab, if we click on a roster name, then it would display the contact details of the roster, which has one phone number, one email address, etc. We needed to display 3 phone numbers from the user profile (on sys_user table) here instead.
I had checked the UI page "$oc_groups" and found that the data is fetched from the UI script "sn_on_call_now.app". However, am not able to locate where exactly and how to make this modification. I guess it is further displaying the detail using the UI macro "on_call_avatar". However, am not getting from where this value is fetched. Could someone help please me with this?
Thanks in advance,
Anu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2019 11:17 PM
We modified the "on_call_avatar" macro for the UI and "OnCallRotation" script include for the data, and it worked!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2019 03:38 PM
Can you please send what you changed and where. What did you change in the OnCallRotation, because it appears to be calling onCallRotationSNC which is read only. Or did you just bring all the script from OnCallRotationSNC and put in in onCallRotation and add in the mobile number?
Thanks
Stacy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2019 09:06 PM
Hi Stacy,
I have changed the OnCallRotation script include. I have added the script for "_getUsers" function from OnCallRotationSNC script include to this script include, and updated the code within that to fetch user's business phone and home phone as well.
Please let me know if any additional info needed.
Regards,
Anu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2025 11:20 PM
Hello Anusarma,
Can you please explain a bit details, where we need to make changes to the Script Include and what all modifications do we need to change to populate multiple Phone number fields under the Contact details in On-Call Scheduling.
Thanks & Regards,
Afreen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2021 09:53 AM
Hi Stacey, Did you ever get this to work? I am just trying to add one more field.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2020 12:04 PM
TL;DR:
We had a similar goal, to edit the On-Call Roster and Escalation details modal (called from the Incident form), to include another field, for pager number. On our user table, we had added two fields: u_pager & u_pager_provider.
This was tough as there were like 10 things in a chain that make this possible, but really only 3 (or 4) things needed updating. Also we noticed some strong caching of the SI, so when testing, use an incognito window and log out and back to see changes.
Solution:
1) Get the data ready by editing the source Script Include
The data that lands in the modal is generated via a method in the script include: OCEscalationPathUtilSNC
This is stock, so you cannot edit, but you can copy it by exporting the XML, changing the name and removing the sys_id, and re-importing. Our new SI is called OCEscalationPathUtilSTU.
Once imported, go to the function _getEscalationStepUsers, and see how the user object var is created with GlideUser.getUserByID, around lines 30-40, depending on your release. This has methods to GetMobileNumber and stuff, but we want to inject our own data into the object, so we had to query it in user2, and add the new fields in the object.
var user = GlideUser.getUserByID(userSysIds[index]);
var user2 = new GlideRecord('sys_user');
user2.get(userSysIds[index]);
var pager = user2.u_pager;
var pagerProv = pager.replace(/[^\d.]/g, '') + user2.u_pager_provider;
if (!user || !user.getID())
continue;
var userProfileDetail = {
user: {
sys_id: userSysIds[index],
avatar: user.getAvatar() || "",
initials: user.getInitials() || "",
name: user.getFullName() || "",
title: user.getTitle() || "",
email: user.getEmail() || "",
pagerProvider: pagerProv || "",
pager: pager || "",
contact_number: user.getMobileNumber() || user.getBusinessNumber() || ""
}
};
userProfiles.push(userProfileDetail);
Great, with the new data in hand, now we need to go upstream to edit what calls this script include.
2) Edit Scripted Rest Resource: escalations (within API OnCallRotation)
(note, this will likely result in a skip at your next upgrade, but that's probably unavoidable and a side cost of this solution)
escalations
Edit line 14 to point to the new SI.
var escalationPathUtil = new OCEscalationPathUtilSTU();
3) Edit the UI Macro that makes up the right side of the modal window.
Update UI Macro: oc_audience_avatars
Add another LI element to add another row in the modal. In our case we copied the phone stanza, and put pager right after it (and before the email LI).
<li class="icon icon-application-generic defaultCursor">
<span class="sr-only">${gs.getMessage('Pager ')}</span>
<span class="avatar-info-item oc-truncate" uib-tooltip="{{audienceDetail.user.pager || form.notAvailable}}" tooltip-class="oc-truncate-tooltip" tooltip-placement="bottom" tooltip-enable="false">
<a ng-if="audienceDetail.user.pager" aria-label="{{form.pagerLabel}} {{audienceDetail.user.pager}}" href="mailto:{{audienceDetail.user.pagerProvider}}">{{audienceDetail.user.pager}}</a>
<span ng-if="!audienceDetail.user.pager" aria-label="{{form.contactNumberLabel}} {{form.notAvailable}}">{{form.notAvailable}}</span>
</span>
</li>
4) (Optional) - Create message/label elements referenced in the macro
Update UI Page: $on_call_who_and_escalation
In the template section for the above macro, add messages for the new Pager fields.
Find $scope.form around line 764, and add after it one new line for the label for Pager:
$scope.form.pagerLabel = i18n.getMessage("Pager");
And it's just that easy! 😛