How to Hide Reports on Overview Tab in SOW workspace

shyam34
Tera Contributor

Hello All , 

Need some Help in Making changes to the Home page on SOW Workspace 

 

Basically I need to Show "Unassigned Incidents" only when we select your team work and should be hidden on your work , Can anyone help how I can hide this 

 

 

 

shyam34_0-1708509887706.png

 

 

@Maik Skoddow @Mathias Rasmuss @Community Alums @Abeer-khan @Haseeb-Ahmed  

 

5 REPLIES 5

Haseeb-Ahmed
ServiceNow Employee
ServiceNow Employee

Hi @shyam34 ,

 

You may want to check out this nice community article on "how to customize landing page"

https://www.servicenow.com/community/itsm-articles/configuration-activities-for-service-operations-w...

 

look for sow-itsm-config-guide-1.3-later.pdf

 

 

1. It will give you sufficient information about the implementation of the landing page, and how to add a new donut or perform customization around that.

2. If we talk about the solution directly you may follow below

 

a. open UX Client Script Include "SowIncidentLandingPageUtilsSNC", and override method "static async getVisualizationConfig(helpers, mode, conditionalRecordCount=0) " in  SowIncidentLandingPageUtils which non snc version of client script.

b. move the object related to "unassigned card" outside of visualizationConfig obj list, and push this "unassigned card" object in the visualizationConfig list based on if condition of my work, please refer screenshot

Screenshot 2024-02-21 at 3.45.13 PM.pngScreenshot 2024-02-21 at 3.48.29 PM.png

c. request you to go through doc once for a better understanding

 

Please mark it helpful if it answers your query.

Thanks,
Haseeb Ahmed

@Haseeb-Ahmed   , I have Amended the "SowIncidentLandingPageUtils" as per your suggestions but it Still failing to hide the Unassigned Donut on my work

 

function include({ imports }) {
    let serviceDeskLandingPageUtilsSNC = imports['sn_sow_inc.SowIncidentLandingPageUtilsSNC']();
    class ServiceDeskLandingPageUtils extends serviceDeskLandingPageUtilsSNC {
        static async getVisualizationConfig(helpers, mode) {
            const evamDef = this.getEvamDef();
            const visualizationConfig = [{
                    "id": "incident_assigned",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
                    "myWorkQuery": "stateIN1,2,3^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
                    "myTeamQuery": "stateIN1,2,3^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": "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",
                },
            ];

            if (mode == 'your_work' && conditionalRecordCount > 0) {
                const conditionalConfig = await this.getConditionalVisualizationConfig(helpers);
                visualizationConfig.push(conditionalConfig);
            }

            if (mode == 'your_work') {
                var unassigned_card =
                    {
                        "id": "unassigned_incidents",
                        "tableName": "incident",
                        "tableDisplayValue": "Incident",
                        "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",
                    };
                visualizationConfig.push(unassigned_card);
            }

            return visualizationConfig;
        }
    }
    return ServiceDeskLandingPageUtils;
}

 

I guess with the current code it will be hiding for my teamwork, put condition as -> if (mode != 'your_work')

This helped. Thank you!