Configurer les anneaux dans la page de destination de niveau 1
Configurez les données affichées dans les anneaux dans la section Vue d'ensemble de la page de destination de niveau 1.
Avant de commencer
Rôle requis : administrateur
Pourquoi et quand exécuter cette tâche
Procédure
- Accédez à Tout > Admin Center de l'Espace de travail pour l'exploitation des services > Vue d'ensemble.
- Dans l'onglet Vue d'ensemble, accédez à la section Configuration initiale, puis sélectionnez l'option Configurer la page de destination.
-
Dans le formulaire Page de destination, sous la section Niveau 1, sélectionnez Configurer en regard de Configurations en anneau.
La définition de l'include de script client SowIncidentLandingPageUtils s'affiche.
-
Modifiez le champ Script, puis ajoutez le code à l’intérieur de la classe ServiceDeskLandingPageUtils.
static async getVisualizationConfig(helpers, mode) { 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", } ]; return visualizationConfig; }Par exemple, pour ajouter un anneau Problème, ajoutez ce qui suit au script pour permettre au nouvel anneau d'interagir avec la liste sur la page de destination. Ces éléments sont copiés à partir de SowIncidentLandingPageUtilsSNC, mais problem_task a été ajoutée.
static async fetchTitle(table, nameValueMap, groupMode = false, elementId) { if (table === "task") { return this.getLabelMaps(table, nameValueMap['sys_class_name'], groupMode, elementId); } return this.getLabelMaps(table, nameValueMap['state'], groupMode, elementId); } static getLabelMaps(table, selectedField, groupMode = false, elementId) { if (selectedField == undefined) { selectedField = 'all'; } const labelMap = { 'incident': { '1': 'New incidents', '2': 'In Progress incidents', '3': 'On Hold incidents', '6': 'Resolved incidents', 'all': 'Incidents' }, 'change_request': { '0': 'In Review changes', '-1': 'Implement changes', '-2': 'Scheduled changes', '-3': 'Authorize changes', '-4': 'Assess changes', '-5': 'New changes', 'all': 'Changes' }, 'problem_task': { '151': 'New', '154': 'Work in Progress', '152': 'Assess', '157': 'Closed', 'all': 'Problem Tasks' }, 'problem': { '101': 'New problems', '102': 'Assess problems', '106': 'Resolved problems', '104': 'Fix in Progress problems', '103': 'Root Cause Analysis problems', 'all': 'Problems' }, 'task': { 'incident_task': 'Incident tasks', 'problem_task': 'Problem tasks', 'change_task': 'Change tasks', 'sc_task': 'Catalog tasks', 'incident': 'Incidents', 'problem': 'Problems', 'change_request': 'Change requests', 'all': 'Tasks' } }; if (elementId === 'delegated_task') return labelMap[table][selectedField] + ' delegated to you'; if (groupMode) return labelMap[table][selectedField] + ' assigned to your team'; return labelMap[table][selectedField] + ' assigned to you'; }Ajoutez le code suivant comme anneau supplémentaire.
{ "id": "problem_task_assigned", "tableName": "problem_task", "tableDisplayValue": "Problem Tasks", "myWorkQuery": "active=true^assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe", "myTeamQuery": "active=true^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744", "listView": mode == "your_work" ? "sow_landing_page_assigned" : "sow_landing_page", "header": mode == 'your_work' ? await helpers.translate("Problem Tasks assigned to you") : await helpers.translate("Problem Tasks assigned to your team"), "groupByField": "state", // "evamId": evamDef['incidentEvamDefinitionId'], "updated_on": "^ORDERBYDESCsys_updated_on", }, - Sélectionnez Mettre à jour.