Service Operation workspace

Efren T_ Marti1
Tera Expert

Hi all, I have been trying to update the "Incidents assigned to me" donut on the Service Operations Workspace to not show resolved incidents, I see that in the data source it references "@state.incAssignedDonut.datasource" Metric label "

@STate.incAssignedDonut.metric" and Group by "@state.incAssignedDonut.groupBy" but when I go to the client state it is blank. Any ideas where we can update it?
 
EfrenT_Marti1_0-1670880524301.pngEfrenT_Marti1_1-1670880604045.pngEfrenT_Marti1_3-1670881149240.png

 

 

1 ACCEPTED SOLUTION

Mathias Rasmuss
Mega Guru

Hi there Efren. 

 

You should be able to make the query as you like. The query is located in 'SowIncidentLandingPageUtilsSNC' script (located at sys_ux_client_script_include) as an encoded query string, you can override the query in 'SowIncidentLandingPageUtils'. Depending on which version your SOW is the code is a bit different. But it should look like this:

 

 

const visualizationConfig = [{
                    "id": "incident_assigned",
                    "tableName": "incident",
                    "tableDisplayValue": "Incident",
//You can change the query here for "My work" and "My teams work"
                    "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 me") : await helpers.translate("Incidents assigned to my team"),
                    "groupByField": "state",
                    "evamId": evamDef['incidentEvamDefinitionId'],
                    "updated_on": "^ORDERBYDESCsys_updated_on",
                }

 

If I helped you with your case, please click the Thumb Icon and mark as Correct.

View solution in original post

7 REPLIES 7

Hello, can we modify the component visibility for each donut? I want members of Change Management Group to be able to view the relevant donuts and not incident related ones. Kindly help me on this

@Mathias Rasmuss I've made the changes to the client script include you mentioned in your post but I received error message on widgets like:

 

Exception while executing request: null. Exception while executing request: null Check logs for error trace or enable glide.rest.debug property to verify REST request processing. Contact your ServiceNow administrator for more information.

Could you please help me?

Thanks!

Aishwarya Shelake

pavan_yakkala1
ServiceNow Employee
ServiceNow Employee

Hello,

By default, sow overview page is not loading the data in widgets (incidents assigned to me). Data source, metric and group by are same as shown in the question.

 

As suggested in the solution, tried overriding method into SowIncidentLandingPageUtils from SowIncidentLandingPageUtilsSNC but no luck

 

Below is the code overridden. Can you suggest ASAP?

 

function include({imports}) {
let serviceDeskLandingPageUtilsSNC = imports['sn_sow_inc.SowIncidentLandingPageUtilsSNC']();
class ServiceDeskLandingPageUtils extends serviceDeskLandingPageUtilsSNC {
/*
static getLabelMaps() {
return "";
}*/
static async getVisualizationConfig(helpers, mode, conditionalRecordCount=0) {
const evamDef = this.getEvamDef();
const visualizationConfig = [{
"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": "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": "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",
}
];

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

return visualizationConfig;
}
}
return ServiceDeskLandingPageUtils;
}