Ui action form context menu is not working on Change request level.

LaraReddy
Tera Guru

Hi All,

We have a "Copy Change" form context menu change requests level and it's not working for ITIL users.

We checked the script include, ACL's as well but we not find any issue. Also the same Ui action is working fine on lower environments and the PDI levels.

UI Action:
Condition:  gs.hasRole("itil,sn_change_write") && ChangeUtils.isCopyChangeEnabled(current)
onClick: OnCopyChangeClick()
Script:


function OnCopyChangeClick() {
    function addParam(form, name, val) {
        var inp = cel('textarea', form);
        inp.name = name;
        inp.value = val;
    }

    var srcSysId = g_form.getUniqueValue();

    var ga = new GlideAjax('ChangeUtils');
    ga.addParam('sysparm_name', 'getChangeQueryParams');
    ga.addParam('sysparm_src_sysid', srcSysId);
    ga.setWantSessionMessages(true);
    ga.getXMLAnswer(function(queryParam) {
        if (queryParam) {
            var gotoURL = new GlideURL('CopyChangeRelatedLists.do');
            gotoURL.setEncode(false);
            gotoURL.addToken();
            gotoURL.addParam('srcSysID', srcSysId);
            gotoURL.addParam('newSysID', '$sys_id');
            gotoURL.addParam('sysparm_returned_action', '$action');

            var form = cel('form', document.body);
            hide(form);
            form.method = "POST";
            form.action = g_form.getTableName() + ".do";
            if (typeof g_ck != 'undefined' && g_ck != "")
                addParam(form, 'sysparm_ck', g_ck);
            addParam(form, 'sys_id', '-1');
            addParam(form, 'sysparm_query', queryParam);
            addParam(form, 'sysparm_goto_url', gotoURL.getURL());
            form.submit();

        }
    });
}

Advance thanks for the support.
2 REPLIES 2

Kieran Anson
Kilo Patron

Hi,

Can you clarify what is occurring, not working is a vague description. Does the UI action result in the page refreshing? Does nothing occur when clicking the UI Action? Are users redirected to a new change form, but it's blank? Have you checked the browser console to view any errors?

Hi Kieran,
Thanks for the response.

When an ITIL user select the copy change context menu, we're not seeing any behavior on the form level, like [Not refreshing / Not loading / not re directing to new page.

We're seeing the below one:

LaraReddy_0-1715161891493.png

 



Thanks.