Service Operations Workspace - Move Incident SLAs ahead of Incidents assigned to you

orlando3
Tera Expert

Hello all, looking for some help, on the SOW i want to reorder some of the visualizations, specifically, i want to move incident sla's ahead of incidents assigned to you.

 

I have updated the SowIncidentLandingPageUtils UX Client script include, but i cannot get the order to change, in the script below, i flipped the order in which they are called in the script thinking that would do the trick.

 

Can anyone spot if my script is indeed correct or if anyone has experience changing these visualizations i would like all the insight i can get.

 

function include({imports}) { 
    let serviceDeskLandingPageUtilsSNC = imports['sn_sow_inc.SowIncidentLandingPageUtilsSNC']();
    class ServiceDeskLandingPageUtils extends serviceDeskLandingPageUtilsSNC {
        /*
        static getLabelMaps() {
            return "";
        }*/

    class ServiceDeskLandingPageUtilsSNC {

        /**
         * Returns visualization configs
         * @Param {object} helpers
         * @Param {string} mode
         * @Param {number} conditionalRecordCount
         * @return object
         */
        static async getVisualizationConfig(helpers, mode, conditionalRecordCount=0) {
            const evamDef = this.getEvamDef();
            const visualizationConfig = [{
        {
                    "id": "incident_sla",
                    "tableName": "task_sla",
                    "tableDisplayValue": "Task SLA",
                    "myWorkQuery": "task.sys_class_name=incident^task.assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^task.active=true^sla.type=SLA^ORsla.type=OLA^active=true^time_left<=1970-01-08 00:00:00",
                    "myTeamQuery": "task.sys_class_name=incident^task.assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^task.active=true^sla.type=SLA^ORsla.type=OLA^active=true^time_left<=1970-01-08 00:00:00",
                    "listView": 'sow_landing_page',
                    "header": await helpers.translate("Incident SLAs"),
                    "groupByField": "time_left",
                    "evamId": evamDef['incidentSlaEvamDefinitionId'],
                    "updated_on": "^ORDERBYtime_left",
                },
                {
                    "id": "incident_assigned",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "active=true^assigned_toISNOTEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page",
                    "header": mode == 'your_work' ? await helpers.translate("Incidents assigned to you") : await helpers.translate("Incidents assigned to your team"),
                    "groupByField": "state",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                },
                {
                    "id": "unassigned_incidents",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "active=true^assigned_toISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "myTeamQuery": "active=true^assigned_toISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page",
                    "header": await helpers.translate("Unassigned incidents"),
                    "groupByField": "priority",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                },
                {
                    "id": "catalog_tasks",
                    "tableName": "sc_task",
                    "tableDisplayValue": "Catalog Task",
                    "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "active=true^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": 'sow_landing_page',
                    "header": mode == 'your_work' ? await helpers.translate("Catalog tasks assigned to you") : await helpers.translate("Catalog tasks assigned to your team"),
                    "groupByField": "state",
                    "evamId": evamDef["catalogTaskEvamDefinitionId"],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                }
            ];

            }

            return visualizationConfig;
        }
    return ServiceDeskLandingPageUtils;
}

 

 

orlando3_0-1717536440137.png

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @orlando3 ,

 

Can you please try the below script- 

function include({imports}) { 
    let serviceDeskLandingPageUtilsSNC = imports['sn_sow_inc.SowIncidentLandingPageUtilsSNC']();
    class ServiceDeskLandingPageUtils extends serviceDeskLandingPageUtilsSNC {
        static async getVisualizationConfig(helpers, mode, conditionalRecordCount=0) {
            const evamDef = this.getEvamDef();
            const visualizationConfig = [
                {
                    "id": "incident_sla",
                    "tableName": "task_sla",
                    "tableDisplayValue": "Task SLA",
                    "myWorkQuery": "task.sys_class_name=incident^task.assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^task.active=true^sla.type=SLA^ORsla.type=OLA^active=true^time_left<=1970-01-08 00:00:00",
                    "myTeamQuery": "task.sys_class_name=incident^task.assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^task.active=true^sla.type=SLA^ORsla.type=OLA^active=true^time_left<=1970-01-08 00:00:00",
                    "listView": 'sow_landing_page',
                    "header": await helpers.translate("Incident SLAs"),
                    "groupByField": "time_left",
                    "evamId": evamDef['incidentSlaEvamDefinitionId'],
                    "updated_on": "^ORDERBYtime_left",
                },
                {
                    "id": "incident_assigned",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "active=true^assigned_toISNOTEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page",
                    "header": mode == 'your_work' ? await helpers.translate("Incidents assigned to you") : await helpers.translate("Incidents assigned to your team"),
                    "groupByField": "state",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                },
                {
                    "id": "unassigned_incidents",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "active=true^assigned_toISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "myTeamQuery": "active=true^assigned_toISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page",
                    "header": await helpers.translate("Unassigned incidents"),
                    "groupByField": "priority",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                },
                {
                    "id": "catalog_tasks",
                    "tableName": "sc_task",
                    "tableDisplayValue": "Catalog Task",
                    "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "active=true^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": 'sow_landing_page',
                    "header": mode == 'your_work' ? await helpers.translate("Catalog tasks assigned to you") : await helpers.translate("Catalog tasks assigned to your team"),
                    "groupByField": "state",
                    "evamId": evamDef["catalogTaskEvamDefinitionId"],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                }
            ];
            return visualizationConfig;
        }
    }
    return ServiceDeskLandingPageUtils;
}

 

Also please try to clear the browser cache and also try to do cache.do in the navigator and then reload the form.

If my response has resolved your query, please consider giving it a thumbs up ‌‌ and marking it as the correct answer‌‌!

 

Thanks & Regards,

Sanjay Kumar

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @orlando3 ,

 

Can you please try the below script- 

function include({imports}) { 
    let serviceDeskLandingPageUtilsSNC = imports['sn_sow_inc.SowIncidentLandingPageUtilsSNC']();
    class ServiceDeskLandingPageUtils extends serviceDeskLandingPageUtilsSNC {
        static async getVisualizationConfig(helpers, mode, conditionalRecordCount=0) {
            const evamDef = this.getEvamDef();
            const visualizationConfig = [
                {
                    "id": "incident_sla",
                    "tableName": "task_sla",
                    "tableDisplayValue": "Task SLA",
                    "myWorkQuery": "task.sys_class_name=incident^task.assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^task.active=true^sla.type=SLA^ORsla.type=OLA^active=true^time_left<=1970-01-08 00:00:00",
                    "myTeamQuery": "task.sys_class_name=incident^task.assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^task.active=true^sla.type=SLA^ORsla.type=OLA^active=true^time_left<=1970-01-08 00:00:00",
                    "listView": 'sow_landing_page',
                    "header": await helpers.translate("Incident SLAs"),
                    "groupByField": "time_left",
                    "evamId": evamDef['incidentSlaEvamDefinitionId'],
                    "updated_on": "^ORDERBYtime_left",
                },
                {
                    "id": "incident_assigned",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "active=true^assigned_toISNOTEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page",
                    "header": mode == 'your_work' ? await helpers.translate("Incidents assigned to you") : await helpers.translate("Incidents assigned to your team"),
                    "groupByField": "state",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                },
                {
                    "id": "unassigned_incidents",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "active=true^assigned_toISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "myTeamQuery": "active=true^assigned_toISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page",
                    "header": await helpers.translate("Unassigned incidents"),
                    "groupByField": "priority",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                },
                {
                    "id": "catalog_tasks",
                    "tableName": "sc_task",
                    "tableDisplayValue": "Catalog Task",
                    "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "active=true^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744",
                    "listView": 'sow_landing_page',
                    "header": mode == 'your_work' ? await helpers.translate("Catalog tasks assigned to you") : await helpers.translate("Catalog tasks assigned to your team"),
                    "groupByField": "state",
                    "evamId": evamDef["catalogTaskEvamDefinitionId"],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                }
            ];
            return visualizationConfig;
        }
    }
    return ServiceDeskLandingPageUtils;
}

 

Also please try to clear the browser cache and also try to do cache.do in the navigator and then reload the form.

If my response has resolved your query, please consider giving it a thumbs up ‌‌ and marking it as the correct answer‌‌!

 

Thanks & Regards,

Sanjay Kumar

Hi @Community Alums 

I tried the updated script and its still not working. I cleared the cache as well.

Community Alums
Not applicable

Hi @orlando3 ,

 

Can you also check the script include where there can be some configs for this -

SowIncidentLandingPageUtils

 

Thanks,

Sanjay Kumar

orlando3
Tera Expert

A couple of my brackets were out of place in my script, once i fixed that, it started working for me. Thank you @Community Alums