Actions
Defect #34212
closedTime Entries POST doesn't work in JSON format
Defect #34212:
Time Entries POST doesn't work in JSON format
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Resolution:
Invalid
Affected version:
Description
Environment¶
fairly stock Redmine 4.1.1, in a docker environment.
Redmine version 4.1.1.stable Ruby version 2.6.6-p146 (2020-03-31) [x86_64-linux-musl] Rails version 5.2.4.2 Environment production Database adapter SQLite Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.12.2 Mercurial 5.3.2 Bazaar 2.7.0 Git 2.24.3 Filesystem Redmine plugins: no plugin installed
Steps to reproduce¶
- create a first redmine project
- create a simple issue
- allow API access
- try to POST to /time_entries.xml with Content-Type application/xml
- try to POST the same data in JSON to /time_entries.json with Content-Type application/json
- try to POST the same data but with hours formatted as number to /time_entries.json with Content-Type application/json
What happens¶
in step 4, XML format, the time entry is created, returns with http 201
in step 5 and 6, JSON format, the endpoint returns with 422 Unprocessable Entity, complaining about
Expected result¶
either step 5 or step 6 (or maybe both) should work, to be able to create a time entry using JSON-based REST API
Actions