Grafana dashboard: OTRS - Chamados fechado x Tempo de atendimento
Description: Relação de chamados fechados e tempo de solução no sistema OTRS 

# Courses e-Learning

https://www.fametreinamentos.com.br

# Support

https://www.fametec.com.br

contato@fametec.com.br

{
  "__inputs": [
    {
      "name": "DS_OTRS",
      "label": "otrs",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.3.3"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 10801,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1567379787648,
  "links": [
    {
      "icon": "doc",
      "includeVars": true,
      "keepTime": true,
      "tags": [],
      "targetBlank": true,
      "title": "PDF Report",
      "tooltip": "",
      "type": "link",
      "url": "http://monitoramento.fametec.com.br:8686/api/v5/report/58u8JmKZz?apitoken=eyJrIjoiSWxXSkV6eUVQME5Ud1NGazlZMGVDU3llOFVaNTdOOTciLCJuIjoicmVwb3J0ZXIiLCJpZCI6MX0="
    }
  ],
  "panels": [
    {
      "columns": [],
      "datasource": "${DS_OTRS}",
      "description": "",
      "fontSize": "100%",
      "gridPos": {
        "h": 20,
        "w": 16,
        "x": 0,
        "y": 0
      },
      "id": 3,
      "options": {},
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 1,
        "desc": true
      },
      "styles": [
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Ticket",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Abertura",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Fechamento",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "mappingType": 1,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select \n  t.tn Ticket,\n  t.title Título, \n  t.create_time Abertura, \n  t.change_time Fechamento, \n  CONCAT (\n    FLOOR(TIMESTAMPDIFF(MINUTE, t.create_time, t.change_time) / 60 / 24), 'd ',  \n    MOD(TIMESTAMPDIFF(HOUR, t.create_time, t.change_time), 24), 'h ',  \n    MOD(TIMESTAMPDIFF(MINUTE, t.create_time, t.change_time), 60), 'm'\n  ) as 'Tempo corrido', \n  CONCAT (\n    FLOOR((TIMESTAMPDIFF(MINUTE, t.create_time, t.change_time) / 60 / 24) / 7) * 5 + least(FLOOR(TIMESTAMPDIFF(MINUTE, t.create_time, t.change_time) / 60 / 24) % 7, 5) + if(weekday(t.change_time) < weekday(t.create_time), -2, 0), 'd ',  \n    MOD(TIMESTAMPDIFF(HOUR, t.create_time, t.change_time), 24), 'h ',  \n    MOD(TIMESTAMPDIFF(MINUTE, t.create_time, t.change_time), 60), 'm'\n  ) as 'Tempo descontado'\nfrom \n  ticket t\nwhere\n  t.create_time >= '$data_inicio' and \n  t.create_time <= '$data_fim' and \n  t.ticket_state_id in (2,3,10) ",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "id"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "acl",
          "timeColumn": "create_time",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Tickets",
      "transform": "table",
      "type": "table"
    }
  ],
  "refresh": "5m",
  "schemaVersion": 19,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "text": "2019-08-01 00:00:00",
          "value": "2019-08-01 00:00:00"
        },
        "hide": 0,
        "label": "Data Inicio",
        "name": "data_inicio",
        "options": [
          {
            "text": "2019-08-01 00:00:00",
            "value": "2019-08-01 00:00:00"
          }
        ],
        "query": "2019-08-01 00:00:00",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {
          "text": "2019-09-01 00:00:00",
          "value": "2019-09-01 00:00:00"
        },
        "hide": 0,
        "label": "Data Fim",
        "name": "data_fim",
        "options": [
          {
            "text": "2019-09-01 00:00:00",
            "value": "2019-09-01 00:00:00"
          }
        ],
        "query": "2019-09-01 00:00:00",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "nowDelay": "10m",
    "refresh_intervals": [
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "OTRS - Chamados fechado x Tempo de atendimento",
  "uid": "58u8JmKZz",
  "version": 36,
  "description": "Relação de chamados fechados e tempo de solução no sistema OTRS "
}