Agent workspace - UI buttons issue

diNesh_M
Tera Contributor

Hi all,

I would like to know why the UI buttons and their functionalities that are configured in ITIL view are not getting reflected in Agent workspace ?

For each and every button we need to go to UI actions and select workspace form button and write a script in workspace client script to make any button work in Agent workspace.

Also would like to know in any of the future release like Newyork or Orlando ,will this remain the same or the buttons we configure in ITIL view will automatically reflect and work in Agent workspace,because it takes lot of effort and time to configure each and every buttons in agent workspace while they already exist in ITIL view.

Any input on this would be highly helpful.

 

Thanks

1 ACCEPTED SOLUTION

Mrigank Gupta
Giga Expert

On creation of a work item, create a scheduled event (let the time be 2 minutes). This will mark the work item as cancelled if the state doesnot change to accepted within 2 minutes.

 

Then wrte a BR on state change to cancelled

 

var originalUser = gs.getSession().impersonate("system");
    gs.getSession().impersonate(originalUser);
    //Closing the interaction on cancellation of work item.
    var intr = new GlideRecord('interaction');
    intr.get(current.document_id);
    intr.setValue('state','closed_abandoned');
    intr.update();
    
    //Fetching the conversation details
    var conversation = sn_connect.Conversation.get(
            intr.channel_metadata_document,
            intr.channel_metadata_table
    );
    
    //Send the message to the partner
    conversation.sendMessage({
        body: gs.getMessage("No agent available"),
        system: true
    });
    //Close the support channel
    new SNC.ConnectListeners().supportSessionClosed(intr.channel_metadata_document);

View solution in original post

11 REPLIES 11

Mrigank Gupta
Giga Expert

On creation of a work item, create a scheduled event (let the time be 2 minutes). This will mark the work item as cancelled if the state doesnot change to accepted within 2 minutes.

 

Then wrte a BR on state change to cancelled

 

var originalUser = gs.getSession().impersonate("system");
    gs.getSession().impersonate(originalUser);
    //Closing the interaction on cancellation of work item.
    var intr = new GlideRecord('interaction');
    intr.get(current.document_id);
    intr.setValue('state','closed_abandoned');
    intr.update();
    
    //Fetching the conversation details
    var conversation = sn_connect.Conversation.get(
            intr.channel_metadata_document,
            intr.channel_metadata_table
    );
    
    //Send the message to the partner
    conversation.sendMessage({
        body: gs.getMessage("No agent available"),
        system: true
    });
    //Close the support channel
    new SNC.ConnectListeners().supportSessionClosed(intr.channel_metadata_document);

Hi Mrigank Gupta,

Thanks for the response. As I'm working on it for the first time I'm not much familiar with this process. Can u please brief on creating the scheduled event as well and how it gets linked to BR? 

Thanks in advance

Hi Mrigank Gupta,

I would like to know is it possible to configure "Copy Incident" & "Create child incident " in Agent workspace.

Beause i found in docs that "The Copy Incident and Create Child Incident UI actions are not available for workspace."

Does it mean they both are not confgiurable or just not available in Agent workspace.

Docs link : https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/administer/workspace/task/configu...

Awaiting your response.

 

Thanks

 

 

You can configure any UI action for workspace view as well.

Hi Mrigank,

Thanks for the response .

when i put the below script for copy incident in agent workspace ,it did not work .

But the same script works in Itil view .

Not sure what changes we need to do to make it work in agent workspace.

 

function OnCopyIncidentClick(){
var srcSysId = g_form.getUniqueValue();
var ga = new GlideAjax('IncidentUtils');
ga.addParam('sysparm_name', 'getIncidentQueryParams');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.addParam('sysparm_ui_action', "copy_incident");
ga.setWantSessionMessages(true);
ga.getXMLAnswer(function(queryParam){
if (queryParam) {
var ck;
if (typeof g_ck != 'undefined' && g_ck != "")
ck = g_ck;

var gotoUrl = [];
gotoUrl.push('srcSysID=' + srcSysId);
gotoUrl.push('newSysID=$sys_id');
gotoUrl.push('sysparm_returned_action=$action');
gotoUrl.push('sysparm_ui_action=copy_incident');
if (ck)
gotoUrl.push('sysparm_ck=' + ck);

gotoUrl = 'CopyIncidentRelatedLists.do?' + gotoUrl.join('&');

var form = cel('form', document.body);
hide(form);
form.method = "POST";
form.action = g_form.getTableName() + ".do";
if (ck)
addParam(form, 'sysparm_ck', g_ck);
addParam(form, 'sys_id', '-1');
addParam(form, 'sysparm_query', queryParam);
addParam(form, 'sysparm_goto_url', gotoUrl);
form.submit();
}else{
g_form.addErrorMessage("Failed to copy incident");
}
});
}
function addParam(form, name, val) {
var inp = cel('textarea', form);
inp.name = name;
inp.value = val;
}

 

Thanks in advance