Configure Change Request Interceptor in Workspaces

mrosok
Tera Expert

I would like to configure the UI Action "Create Change Request" on an Incident, so that when the user selects a Normal Change Request, some additional fields are copied over from the Incident.

 

 The UI Action creates a modal interceptor that allows you to select Normal, Standard or Emergency change types.

I don't know how this interceptor logic works or where I can go further to configure.

 

Any help would be appreciated

 

function onClick(g_form) {

    getMessages(['Create Change Request', 'Create', 'Cancel'], openInterceptorModal);

   

    function openInterceptorModal(msg) {

        var result = g_form.submit('create_std_change');

        if (!result) {

            return;

        }

        result.then(function() {

            g_modal.sn_itsm_workspace.showInterceptor({

                title: msg['Create Change Request'],

                confirmTitle: msg['Create'],

                cancelTitle: msg['Cancel'],

                size:'sm',

                height:'md',

                params: {"modal": "false","target":"change_request"}})

            .then(function(modalResult){

                if (modalResult.data) {

                    if (modalResult.data.table != 'sc_cat_item') {

                        console.log(modalResult);

                        g_aw.openRecord(modalResult.data.table, modalResult.data.sys_id, {query:modalResult.data.query});

                    }

                    else {

                        var ga = new GlideAjax('StdChangeUtils');

                        ga.addParam('sysparm_name', 'ajaxFunction_getCategory');

                        ga.getXMLAnswer(function (answer) {

                            if (answer) {

                                var params =modalResult.data.params;

                                params.sysparm_parent_table = "incident";

                                params.sysparm_parent_sys_id = g_form.getUniqueValue();

                                g_service_catalog.openCatalogItem('sc_cat_item', '-1', params);

                            }

                        });

                    }

                }

            });

        });

    }

}
3 REPLIES 3

Abbas_5
Tera Sage
Tera Sage

Hello @mrosok,

Please refer to the below link:
https://www.servicenow.com/community/itsm-forum/agent-workspace-ui-action-to-change-interceptor/td-p...

 

If it is helpful, please mark it as helpful and accept the correct solution.

Thanks & Regards,

Abbas Shaik

Thank you for your reply. Unfortunately this is not helpful to me. I want a better understanding of the interceptor modal used in workspace. I don't want to bypass it and redirect to the interceptor page. That would remove me from the incident that I need to get data from.

Did you get a solution for this ?