How to remove cancelled SLA in the incident SLA list in the service portal

Indira8
Kilo Sage

Hello All,

 

We have a requirement to remove the cancelled slas for a particular incident in the service portal in the incident sla widget. 

Could you please help how to add the filter in the widget to hide only the cancelled slas.

 

Thank you 

6 REPLIES 6

Alka_Chaudhary
Mega Sage
Mega Sage

Hello @Indira8 ,

 

Which widget you are using to display incident SLA's?

Hi @Alka_Chaudhary , 

 

I am new to portal and how to know which widget we are using .

 

thank you 

Hi @Alka_Chaudhary , the widget is Incident_TaskSLA 

The following is the server script :

 

(function() {
    /*  "use strict"; - linter issues */
    // populate the 'data' object
    var ritmSysid = $sp.getParameter("sys_id");
    var sp_page = $sp.getValue('sp_page');
    var pageGR = new GlideRecord('sp_page');
    pageGR.get(sp_page);
    data.page_id = pageGR.id.getDisplayValue();
    $sp.getValues(data);
    if (data.field_list) {
        data.fields_array = data.field_list.split(',');
//gs.addInfoMessage(' data.fields_array :' + data.fields_array );
    } else {
        data.field_list = $sp.getListColumns(data.table);
    }
 
    if (input) {
        data.p = input.p;
        data.o = input.o;
        data.d = input.d;
        data.q = input.q;
    }
    data.p = data.p || 1;
    data.o = data.o || $sp.getValue('order_by');
    data.d = data.d || $sp.getValue('order_direction');
 
    data.page_index = (data.p - 1);
    data.window_size = $sp.getValue('maximum_entries') || 10;
    data.window_start = (data.page_index * data.window_size);
    data.window_end = (((data.page_index + 1) * data.window_size));
    data.filter = $sp.getValue("filter");
//gs.addInfoMessage(' data.filter'+ data.filter);
    data.task = $sp.getParameter("sys_id");
 
    var gr = new GlideRecordSecure(data.table);
    if (!gr.isValid()) {
        data.invalid_table = true;
        data.table_label = data.table;
        return;
    }
    data.table_label = gr.getLabel();
 
    var widgetParams = {
        table: data.table,
        fields: data.field_list,
        o: data.o,
        d: data.d,
filter: 'task=' + data.task + '^' + data.filter,
        //filter: 'task=' + data.task +'^sla.type=SLA',
        window_size: data.window_size,
        view: 'sp',
        title: options.title,
 
Thank you 
        //initialQuery: 'task='+data.task
    };
 //   gs.addInfoMessage('table :' + widgetParams.table);
 
 
    data.dataTableWidget = $sp.getWidget('widget-data-table-itc', widgetParams);
})();

 

You can edit the widget instance and add filter to only show sla's which are not cancelled.

Example: stage!=cancelled