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

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.

Hi Mathias, thank you, been heading my head against the wall on this one. ðŸ˜‰

 

For others in my situation here is what I ended up doing in my PDI. Hope this helps. If anyone knows of a better/easier solution let me know.

 

Objective: On the Service Operations workspace do not show resolved incidents on the components

Instance:

Build name: Tokyo

 

  • Created a variant of the Service desk landing page using UI builder and gave it a spiffy new name
  • On the Incidents assigned to me component, click the config then in the data you should see Incident, click on it, then add your filter. In my case I added State is not resolved 
    • Removed this line as I had it hard coded and it broke when I changed to my team's work, leave as default as Mathias solution should work.
    • Before BeforeBefore

       

    • After EfrenT_Marti1_1-1671737336985.png

       

  • While this work for the donuts you will notice the bottom component will still display resolved incidents
    • Before EfrenT_Marti1_2-1671737548107.png
  • In the UI builder go to the component and take note of the data resource should start with @Data in the config section, then bottom left side click on Data icon and in data resources find the data resource you noted earlier, notice the query is pointing to a State query, take note of the state name
  • Click on the Client state icon under the data resource button, find the State name you noted earlier, should be "currentVizSelection", in the query add ^state!=6 to the query should look like this
    • active=true^state!=6^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORDERBYDESC$AGGREGATE$^ORDERBYDESCsys_updated_on
  • also update "queryForViewAllRecordCount" with ^state!=6, should look like this
    • active=true^state!=6^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORDERBYDESC$AGGREGATE$^ORDERBYDESCsys_updated_on
  • scroll down and click apply, then save the page
  • On the workspace refresh the page you will now notice on load the resolved incident will not be shown, may auto refresh after a few seconds, do a manual refresh if needed
    • After EfrenT_Marti1_3-1671738243836.png

       

  • So far everything was working until you change the My Work to My Team's work and vice versa
    • EfrenT_Marti1_4-1671738365365.png

       

    • EfrenT_Marti1_5-1671738495664.png
  • Here is where Mathias solution comes in play ðŸ˜Ž
  • Go to the table sys_ux_client_script_include and find the two script includes below
    • SowIncidentLandingPageUtilsSNC
    • SowIncidentLandingPageUtils
  • You will need to make a new script include and copy the contents/settings of the script include SowIncidentLandingPageUtilsSNC as it read only
  • after you name your spiffy new script include and pasted the contents update two lines under the const query, I added ^state!=6^, should look like this. save the record
    • EfrenT_Marti1_6-1671738786204.png

       

  • Go the script include SowIncidentLandingPageUtils and here we are going to update the script include name that I highlighted in the screen shot and also remove the current client script include dependencies and add our Spiffy new name one
    •  EfrenT_Marti1_8-1671739072971.png

       

    • EfrenT_Marti1_7-1671738957618.png

       

  • Save the record
  • In the workspace refresh, and change the My Work to My Team's Work, this time you should not see any resolved incidents. If you change back to My Work, you should not see any resolved incident
    • EfrenT_Marti1_10-1671739898917.png

       


       

  • Done

 

 

Hi Mathias, 

 

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;
}

@Mathias Rasmuss @pavan_yakkala1

could you please advise why SowIncidentLandingPageUtilsSNC is different between instances?
in mycase I am not sure why, but DEV and QA (UAT) differ from each other as seen below
at first glance same plugins are installed
thanks!

tovtyneduard_1-1702208146326.png

tovtyneduard_0-1702208124155.png