{"action":"created","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/8260","repository_url":"https://api.github.com/repos/grafana/grafana","labels_url":"https://api.github.com/repos/grafana/grafana/issues/8260/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/8260/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/8260/events","html_url":"https://github.com/grafana/grafana/issues/8260","id":225473980,"node_id":"MDU6SXNzdWUyMjU0NzM5ODA=","number":8260,"title":"[bug] Elasticsearch date histogram Field stuck with timeField from ds","user":{"login":"Kotove","id":20931163,"node_id":"MDQ6VXNlcjIwOTMxMTYz","avatar_url":"https://avatars3.githubusercontent.com/u/20931163?v=4","gravatar_id":"","url":"https://api.github.com/users/Kotove","html_url":"https://github.com/Kotove","followers_url":"https://api.github.com/users/Kotove/followers","following_url":"https://api.github.com/users/Kotove/following{/other_user}","gists_url":"https://api.github.com/users/Kotove/gists{/gist_id}","starred_url":"https://api.github.com/users/Kotove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kotove/subscriptions","organizations_url":"https://api.github.com/users/Kotove/orgs","repos_url":"https://api.github.com/users/Kotove/repos","events_url":"https://api.github.com/users/Kotove/events{/privacy}","received_events_url":"https://api.github.com/users/Kotove/received_events","type":"User","site_admin":false},"labels":[{"id":257659118,"node_id":"MDU6TGFiZWwyNTc2NTkxMTg=","url":"https://api.github.com/repos/grafana/grafana/labels/P3:%20important","name":"P3: important","color":"fef2c0","default":false},{"id":257656280,"node_id":"MDU6TGFiZWwyNTc2NTYyODA=","url":"https://api.github.com/repos/grafana/grafana/labels/datasource:%20Elasticsearch","name":"datasource: Elasticsearch","color":"85c92c","default":false},{"id":82333616,"node_id":"MDU6TGFiZWw4MjMzMzYxNg==","url":"https://api.github.com/repos/grafana/grafana/labels/effort1:%20small","name":"effort1: small","color":"bfe5bf","default":false},{"id":223098243,"node_id":"MDU6TGFiZWwyMjMwOTgyNDM=","url":"https://api.github.com/repos/grafana/grafana/labels/help%20wanted","name":"help wanted","color":"bfe5bf","default":true},{"id":70176318,"node_id":"MDU6TGFiZWw3MDE3NjMxOA==","url":"https://api.github.com/repos/grafana/grafana/labels/type:%20bug","name":"type: bug","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-05-01T17:07:17Z","updated_at":"2018-08-14T14:44:06Z","closed_at":null,"author_association":"NONE","body":"Continuing [https://github.com/grafana/grafana/issues/4004](https://github.com/grafana/grafana/issues/4004)\r\n> the JSON for the dashboard doesn't change. I tested this by changing other features like the alias and closing and opening the JSON panel; the alias was different but the field and timeField values were unchanged. Regardless of what I provide for the Date Histogram field, I get\r\n\r\nreproduced on 4.2.0.\r\nthe value selected in the Date Histogram field doesn't appear in corresponding Target.\r\nFrom my point of view - it is hardcoded here:\r\ngrafana/public/app/plugins/datasource/elasticsearch/query_builder.js:\r\n```\r\nElasticQueryBuilder.prototype.getDateHistogramAgg = function(aggDef) {\r\n   ...\r\n    esAgg.field = this.timeField;\r\n   ...\r\n```\r\n\r\nTo get field from what is configured in query (but not cloned from main datasource timeField)\r\n```\r\nElasticQueryBuilder.prototype.getDateHistogramAgg = function(aggDef) {\r\n    ...\r\n    esAgg.field = aggDef.field; \r\n    ...\r\n```"},"comment":{"url":"https://api.github.com/repos/grafana/grafana/issues/comments/412897068","html_url":"https://github.com/grafana/grafana/issues/8260#issuecomment-412897068","issue_url":"https://api.github.com/repos/grafana/grafana/issues/8260","id":412897068,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjg5NzA2OA==","user":{"login":"FranklinSamboni","id":11491324,"node_id":"MDQ6VXNlcjExNDkxMzI0","avatar_url":"https://avatars2.githubusercontent.com/u/11491324?v=4","gravatar_id":"","url":"https://api.github.com/users/FranklinSamboni","html_url":"https://github.com/FranklinSamboni","followers_url":"https://api.github.com/users/FranklinSamboni/followers","following_url":"https://api.github.com/users/FranklinSamboni/following{/other_user}","gists_url":"https://api.github.com/users/FranklinSamboni/gists{/gist_id}","starred_url":"https://api.github.com/users/FranklinSamboni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FranklinSamboni/subscriptions","organizations_url":"https://api.github.com/users/FranklinSamboni/orgs","repos_url":"https://api.github.com/users/FranklinSamboni/repos","events_url":"https://api.github.com/users/FranklinSamboni/events{/privacy}","received_events_url":"https://api.github.com/users/FranklinSamboni/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T14:44:06Z","updated_at":"2018-08-14T14:44:06Z","author_association":"NONE","body":"+1"}}
{"actor":{"display_login":"FranklinSamboni"}}