cancel
Showing results for 
Search instead for 
Did you mean: 

Write date field property in Automation Chain

ssze_
Star Contributor
Star Contributor

Hi,

I would like to write date entry to a multi-valued complex field in an automation

Unfortunately my POST request leads to errors when I use @{org.nuxeo.ecm.core.schema.utils.DateParser.formatW3CDateTime(CurrentDate.date)} as suggested in the API playground:

POST /nuxeo/site/automation/Document.Update HTTP/1.1
HOST: localhost:8080
x-authentication-token: xxx
x-nxrepository: default
x-nxproperties: *
x-nxvoidoperation: false
content-type: application/json+nxrequest
cookie: X-Authentication-Token=xxx
content-length: 265

{"params":{"properties":"approval:approval/approval_a_typ=2\napproval:approval/approval_date=@{org.nuxeo.ecm.core.schema.utils.DateParser.formatW3CDateTime(CurrentDate.date)}","save":"true"},"input":"/default-domain/workspaces/Sample Content/Test","context":{}}

{
"entity-type": "exception"
"code": "org.nuxeo.ecm.automation.TraceException"
"status": 500
}

In case I add the date manually it works:

{"params":{"properties":"approval:approval/approval_a_typ=1\napproval:approval/approval_date=2016-09-09T11:14:42Z\napproval:approval/approval_approver=Administrator","save":"true"},"input":"/default-domain/workspaces/Sample Content/Test","context":{}}

How can I add the current date? Any help highly appreciated.

Thanks

Stefan

3 REPLIES 3

ssze_
Star Contributor
Star Contributor

2016-09-09 14

pibou_Bouvret
Elite Collaborator
Elite Collaborator

I don t think you can use EL (@{org.nuxeo.ecm.core.schema.utils.DateParser.formatW3CDateTime(CurrentDate.date)} ) along with the REST API

then the info on the nuxeo API playground (/nuxeo/playground/#/commands/Document.Update) should be updated accordingly as it says