Add link to on-call record next to assignment group on the incident tickets??

Selva Arun
Mega Sage
Mega Sage

Hi All,

 

Has anyone implemented the below requirements:

 

Add link to on-call record next to assignment group on the incident tickets.

 

I followed the https://servicenowguru.com/ui-macros/on-call-calendar-popup-ui-macro/# and made few modifications, but UI macro icon is not showing up on the form.

Please advise.

<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
    <span id="${jvar_n}" class="btn btn-default icon-date-time" tabindex="0" title="${gs.getMessage('Show group on-call schedule')}">
        <span class="sr-only">${gs.getMessage('Show group on-call schedule')}</span>
    </span>
    <script>
        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);
            grpRota.query();

            if (grpRota.hasNext()) {
                // 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
                popupOpenStandard(url);
            } else {
                alert('No active rotation specified for the selected group.');
            }
        }
    </script>
</j:jelly>

 

2 ACCEPTED SOLUTIONS

Selva Arun
Mega Sage
Mega Sage

I fixed the issue by myself after modifying the jelly script and the dictionary override. Thank you!

View solution in original post

8 REPLIES 8

Paul Curwen
Giga Sage

Have you also added the attribute on the Assignment Group field? If you do not add that you will not see anything:

 

ref_contributions=show_group_on_call_schedule 

 

You also need to have the ‘on_call scheduling’ plugin being installed.

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

Yes, please !

 

I have added the ref_contributions attribute, still it is not working. Please help!

Slava Savitsky
Giga Sage

Have you added "ref_contributions" attribute to the dictionary entry of your reference field?

Yes, please !

 

I have added it.