-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Watcher: Scripting does not allow use of DateTime objects anymore #35913
Copy link
Copy link
Closed
Description
Elasticsearch version (bin/elasticsearch --version): 6.5.1
Description of the problem including expected versus actual behavior:
Steps to reproduce:
POST _xpack/watcher/watch/_execute
{
"watch": {
"trigger": {
"schedule": {
"interval": "10s"
}
},
"input": {
"none": {}
},
"transform": {
"script": {
"source": "return [ 'time_scheduled': ctx.trigger.scheduled_time.getMillis() ]",
"lang": "painless"
}
},
"actions": {
"logging": {
"logging": {
"text": "{{ctx.payload}}"
}
}
}
}
}
Returns
"script" : "return [ 'time_scheduled': ctx.trigger.scheduled_time.getMillis() ]",
"lang" : "painless",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "dynamic method [org.joda.time.DateTime, getMillis/0] not found"
}
I think the reason for this is, that we do not expose org.joda.time.DateTime in scripting anymore, only, correct @rjernst ?
I think the proper solution is to convert the DateTime objects in the watch context to joda compatible zoned date times in the next patch release.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Fields
Give feedbackNo fields configured for issues without a type.