[Bug] Cannot read property 'originalUrl' of undefined

Hello,

I have an issue with the snapshot navbar. I create the snapshot with the HTTP API and use the url from the response into an iframe.

Here’s my GitHub post :
https://github.com/grafana/grafana/issues/8908

Here’s my JSON :

{
“dashboard”:
{
“annotations”: {
“list”: []
},
“editMode”: false,
“editable”: true,
“gnetId”: null,
“graphTooltip”: 0,
“hideControls”: false,
“id”: 1,
“links”: [],
“rows”: [
{
“collapse”: false,
“height”: “250px”,
“panels”: [
{
“aliasColors”: {},
“bars”: false,
“datasource”: “analyticsDB”,
“fill”: 1,
“id”: 1,
“legend”: {
“avg”: false,
“current”: false,
“max”: true,
“min”: true,
“show”: true,
“total”: false,
“values”: true
},
“lines”: true,
“linewidth”: 1,
“nullPointMode”: “connected”,
“percentage”: false,
“pointradius”: 2,
“points”: true,
“renderer”: “flot”,
“seriesOverrides”: [],
“span”: 12,
“stack”: false,
“steppedLine”: false,
“targets”: [
{
“dsType”: “influxdb”,
“groupBy”: [
{
“params”: [
"$__interval"
],
“type”: “time”
}
],
“measurement”: “Events”,
“orderByTime”: “ASC”,
“policy”: “default”,
“refId”: “A”,
“resultFormat”: “time_series”,
“select”: [
[
{
“params”: [
“seats”
],
“type”: “field”
},
{
“params”: [],
“type”: “sum”
}
]
],
“tags”: [
{
“key”: “eventId”,
“operator”: “=”,
“value”: “1”
}
]
}
],
“thresholds”: [],
“timeFrom”: null,
“timeShift”: null,
“title”: “Seats / Time”,
“tooltip”: {
“shared”: true,
“sort”: 0,
“value_type”: “individual”
},
“transparent”: true,
“type”: “graph”,
“xaxis”: {
“mode”: “time”,
“name”: null,
“show”: true,
“values”: [
“total”
]
},
“yaxes”: [
{
“format”: “none”,
“logBase”: 1,
“max”: null,
“min”: 0,
“show”: true
},
{
“format”: “none”,
“logBase”: 1,
“show”: false
}
]
}
],
“repeat”: null,
“repeatIteration”: null,
“repeatRowId”: null,
“showTitle”: false,
“title”: “Dashboard Row”,
“titleSize”: “h6”
}
],
“schemaVersion”: 14,
“style”: “dark”,
“tags”: [],
“templating”: {
“list”: []
},
“time”: {
“from”: “now-15d”,
“to”: “now”
},
“timepicker”: {
“refresh_intervals”: [
“5s”,
“10s”,
“30s”,
“1m”,
“5m”,
“15m”,
“30m”,
“1h”,
“2h”,
“1d”
],
“time_options”: [
“5m”,
“15m”,
“1h”,
“6h”,
“12h”,
“24h”,
“2d”,
“7d”,
“30d”
]
},
“timezone”: “browser”,
“title”: “Title Test”
},
“expires”: 3600
}

GRAFANA VERSION : 4.3.2

you json is missing a snapshot object on your json.

add this property to the dashboard object

"snapshot": {
  "timestamp": "when this snapshot was made",
  "originalUrl": "url to original dashboard this snapshot was made from"
}

Thank you !
The “orignalUrl” line is enough to fix it.