Grafana dashboard: Technical Support Statistics Dashboard
Description: This is a modification of https://grafana.com/grafana/dashboards/10840 by leandro4gl.  Thanks for your initial dashboard. It was very helpful to create this one.

This is a modification of https://grafana.com/grafana/dashboards/10840 by leandro4gl.  Thanks for your initial dashboard. It was very helpful to create this one.  

This dashboard shows many statistics from the osTicket ticket system for technical support.


{
  "__inputs": [
    {
      "name": "DS_OSTICKET",
      "label": "osTicket",
      "description": "ticket data from osTicket support system.",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "This is a modification of https://grafana.com/grafana/dashboards/10840 by leandro4gl.  Thanks for your initial dashboard. It was very helpful to create this one.",
  "editable": true,
  "gnetId": 11403,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "content": "<h1 style=\"text-align: center;\">ESG Technical Support Statistics</h1>",
      "datasource": "${DS_OSTICKET}",
      "gridPos": {
        "h": 2,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 12,
      "mode": "html",
      "options": {},
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "content": "<h2 style=\"text-align: center;\">Today</h2>\n<hr>",
      "datasource": "${DS_OSTICKET}",
      "gridPos": {
        "h": 2,
        "w": 6,
        "x": 0,
        "y": 2
      },
      "id": 21,
      "mode": "html",
      "options": {},
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "content": "<h2 style=\"text-align: center;\">Yesterday</h2>\n<hr>",
      "datasource": "${DS_OSTICKET}",
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 6,
        "y": 2
      },
      "id": 23,
      "mode": "html",
      "options": {},
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_OSTICKET}",
      "description": "",
      "gridPos": {
        "h": 8,
        "w": 5,
        "x": 9,
        "y": 2
      },
      "id": 10,
      "links": [],
      "options": {
        "fieldOptions": {
          "calcs": [
            "sum"
          ],
          "defaults": {
            "mappings": [],
            "max": 100,
            "min": 0,
            "thresholds": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-orange",
                "value": 30
              },
              {
                "color": "light-yellow",
                "value": 65
              },
              {
                "color": "semi-dark-green",
                "value": 95
              }
            ],
            "unit": "percent"
          },
          "override": {},
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.5.1",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select (sum(case when t.created + interval s.grace_period hour <= now() then 0 else 1 end) / count(*)) * 100 pct_sla_on_time\r\n  from ost_ticket t\r\n  left join ost_sla s\r\n    on s.id = t.sla_id\r\n where closed is null\r\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "On-Time Resolution",
      "type": "gauge"
    },
    {
      "columns": [],
      "datasource": "${DS_OSTICKET}",
      "fontSize": "120%",
      "gridPos": {
        "h": 8,
        "w": 5,
        "x": 14,
        "y": 2
      },
      "id": 14,
      "options": {},
      "pageSize": null,
      "scroll": false,
      "showHeader": true,
      "sort": {
        "col": null,
        "desc": false
      },
      "styles": [
        {
          "alias": "Qtd",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Qtd",
          "type": "number",
          "unit": "none"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select ts.name Status\r\n     , count(*) Qty\r\n  from ost_ticket t\r\n  left join ost_ticket_status ts\r\n    on ts.id = t.status_id\r\n where ts.state = 'open' and t.dept_id = 1\r\n group by 1\r\n order by 2 desc, 1\r\n",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Open by Status",
      "transform": "table",
      "type": "table"
    },
    {
      "columns": [],
      "datasource": "${DS_OSTICKET}",
      "description": "Number of tickets open for this time by age",
      "fontSize": "110%",
      "gridPos": {
        "h": 8,
        "w": 5,
        "x": 19,
        "y": 2
      },
      "id": 4,
      "options": {},
      "pageSize": null,
      "scroll": false,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": false
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 0,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select case \r\n            when TIMESTAMPDIFF(HOUR,t.created,ifnull(t.closed,now())) <= 02 then '0. Up to 2 Hours'\r\n            when TIMESTAMPDIFF(HOUR,t.created,ifnull(t.closed,now())) <= 04 then '1. Up to 4 Hours'\r\n            when TIMESTAMPDIFF(HOUR,t.created,ifnull(t.closed,now())) <= 08 then '2. Up to 8 Hours'\r\n            when TIMESTAMPDIFF(HOUR,t.created,ifnull(t.closed,now())) <= 24 then '3. Up to 24 Hours'\r\n            when TIMESTAMPDIFF( DAY,t.created,ifnull(t.closed,now())) <= 02 then '4. Up to 2 Days'\r\n            when TIMESTAMPDIFF( DAY,t.created,ifnull(t.closed,now())) <= 07 then '5. Up to 7 Days'\r\n            when TIMESTAMPDIFF( DAY,t.created,ifnull(t.closed,now()))  > 07 then '6. Greater than 8 Days'\r\n          end \"Creation Age\"\r\n      , count(*) Qty\r\n  from ost_ticket t\r\n where closed is null AND status_id IN (1,2,7)\r\n group by 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Open By Age",
      "transform": "table",
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorPostfix": false,
      "colorPrefix": false,
      "colorValue": false,
      "colors": [
        "#56A64B",
        "#FFEE52",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "decimals": 0,
      "description": "",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 6,
        "w": 3,
        "x": 0,
        "y": 4
      },
      "id": 2,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "80%",
      "prefix": "",
      "prefixFontSize": "100%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": true,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "Situacao",
          "rawQuery": true,
          "rawSql": "select count(*) Open\r\n  from ost_ticket \r\n where status_id IN(1,6,7) AND dept_id = 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ticket_id"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "v_relat",
          "timeColumn": "DataCriacao",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "45,75",
      "timeFrom": null,
      "timeShift": null,
      "title": "Open Tickets",
      "type": "singlestat",
      "valueFontSize": "200%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 3,
        "y": 4
      },
      "id": 16,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": " Open",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) Opened\r\nFROM ost_ticket t\r\nWHERE cast(t.created AS date) = cast(NOW() AS date) AND dept_id = 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 6,
        "y": 4
      },
      "id": 24,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": " Open",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT sum(T.created >= date_format(subdate(now(),1), \"%Y-%m-%d\") AND T.created <= date_format(now(),\"%Y-%m-%d\"))\r\nFROM ost_ticket T\r\n\tJOIN ost_ticket_status S ON T.status_id = S.id\r\nWHERE T.dept_id = 1\r\n/*\r\nSELECT COUNT(*) Opened\r\nFROM ost_ticket t\r\nWHERE cast(t.created AS date) = cast(NOW() AS date) AND dept_id = 1*/",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 3,
        "y": 6
      },
      "id": 19,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": " Closed",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) Closed\r\nFROM ost_ticket t\r\nWHERE cast(t.closed AS date) = cast(NOW() AS date) AND dept_id = 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 6,
        "y": 6
      },
      "id": 25,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": " Closed",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT sum(T.closed >= date_format(subdate(now(),1), \"%Y-%m-%d\") AND T.closed <= date_format(now(),\"%Y-%m-%d\"))\r\nFROM ost_ticket T\r\n\tJOIN ost_ticket_status S ON T.status_id = S.id\r\nWHERE T.dept_id = 1\r\n/*\r\nSELECT COUNT(*) Closed\r\nFROM ost_ticket t\r\nWHERE cast(t.closed AS date) = cast(NOW() AS date) AND dept_id = 1*/",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 3,
        "y": 8
      },
      "id": 22,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": " Reopened",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT COUNT(*) Reopened\r\nFROM ost_ticket t\r\nWHERE cast(t.reopened AS date) = cast(NOW() AS date) AND dept_id = 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_OSTICKET}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 6,
        "y": 8
      },
      "id": 26,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": " Reopened",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT sum(T.reopened >= date_format(subdate(now(),1), \"%Y-%m-%d\") AND T.reopened <= date_format(now(),\"%Y-%m-%d\"))\r\nFROM ost_ticket T\r\n\tJOIN ost_ticket_status S ON T.status_id = S.id\r\nWHERE T.dept_id = 1\r\n/*\r\nSELECT COUNT(*) Reopened\r\nFROM ost_ticket t\r\nWHERE cast(t.reopened AS date) = cast(NOW() AS date) AND dept_id = 1*/",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_OSTICKET}",
      "decimals": 0,
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "hiddenSeries": false,
      "id": 28,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": false,
        "sideWidth": null,
        "total": true,
        "values": true
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/Opened/i",
          "color": "#e34d42"
        },
        {
          "alias": "/Closed/i",
          "color": "#6ed0e0"
        },
        {
          "alias": "/Reopened/i",
          "color": "rgb(77, 75, 75)"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [
            {
              "params": [
                "24h",
                "0"
              ],
              "type": "time"
            }
          ],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  CONCAT(DATE_FORMAT(created, \"%m-%d\"), \" - Opened\") AS metric,\n  $__timeGroupAlias(created,5m,0),\n  COUNT(ticket_id) AS value\nFROM ost_ticket\nWHERE\n  $__timeFilter(created)\n  AND dept_id = 1\nGROUP BY metric, time\nUNION\n  SELECT CONCAT(DATE_FORMAT(closed, \"%m-%d\"), \" - Closed\") AS metric,\n  $__timeGroupAlias(closed,5m,0),\n  COUNT(ticket_id) AS value\nFROM ost_ticket\nWHERE\n  $__timeFilter(closed)\n  AND dept_id = 1\nGROUP BY metric, time\nUNION\n  SELECT CONCAT(DATE_FORMAT(reopened, \"%m-%d\"), \" - Reopened\") AS metric,\n  $__timeGroupAlias(reopened,5m,0),\n  COUNT(ticket_id) AS value\nFROM ost_ticket\nWHERE\n  $__timeFilter(reopened)\n  AND dept_id = 1\nGROUP BY metric, time\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ticket_id"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "Opened"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "ost_ticket",
          "timeColumn": "created",
          "timeColumnType": "datetime",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            },
            {
              "datatype": "datetime",
              "name": "",
              "params": [
                "created",
                "=",
                "date('2019-12-07')"
              ],
              "type": "expression"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Total Tickets",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "series",
        "name": null,
        "show": true,
        "values": [
          "total"
        ]
      },
      "yaxes": [
        {
          "decimals": 0,
          "format": "none",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_OSTICKET}",
      "decimals": 0,
      "fill": 2,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 17
      },
      "hiddenSeries": false,
      "hideTimeOverride": true,
      "id": 6,
      "interval": "",
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 3,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT CAST(t.date_time as date) time,\r\n      (SELECT COUNT(*) FROM ost_ticket\r\n        WHERE CAST(created AS date) <= t.date_time AND dept_id=1\r\n          AND ((status_id IN (1,6,7) AND closed IS NULL) OR CAST(closed AS date) > t.date_time)) Trend\r\n  FROM (SELECT CAST(created AS date) AS date_time, status_id FROM ost_ticket WHERE $__timeFilter(created) AND dept_id=1\r\n        UNION \r\n        SELECT CAST(closed AS date) AS date_time, status_id FROM ost_ticket WHERE $__timeFilter(closed) AND dept_id=1) t\r\n ORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Open Ticket Trend",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "1m",
  "schemaVersion": 21,
  "style": "dark",
  "tags": [
    "ticket",
    "osticket",
    "SLA",
    "backlog",
    "open",
    "closed"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Technical Support Statistics Dashboard",
  "uid": "8VJ_PAcWz",
  "version": 28
}