Defect #29069
openAPI reports wrong date for time spent if issue start date is greater than spent_on date
0%
Description
If time is entered on a date prior to an issue's start date, the API reports the start date of the issue in the XML response, not the "spent_on" date entered into the time commit.
Environment:
Redmine version 3.2.6.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.10
Mercurial 3.1.2
Bazaar 2.7.0
Git 2.1.4
Filesystem
Redmine plugins:
no plugin installed
Updated by Go MAEDA over 6 years ago
I could not reproduce the problem. Could you describe detailed steps to reproduce?
Updated by Ty You over 6 years ago
Create an issue, then log time against that issue with a "spent_on" date from before the create date of the issue. Then pull that time via the API.
For me, the "spent_on" date changes to the create date of the issue, not the spent_on date of the time entry.
Updated by Go MAEDA over 6 years ago
I still cannot reproduce it on the current trunk (3.4.6.devel.17428).
I created an issue #148 on 2018-07-03. Then, logged 12 hours of spent time for 2018-07-01. After that, I made an API request and got the following response. The value for "spent_on" is "2018-07-01". I could not find any problem.
{ "time_entry": { "id": 41, "project": { "id": 1, "name": "eCookbook" }, "issue": { "id": 148 }, "user": { "id": 1, "name": "Admin Redmine" }, "activity": { "id": 10, "name": "Development" }, "hours": 12, "comments": "", "spent_on": "2018-07-01", "created_on": "2018-07-03T07:00:18Z", "updated_on": "2018-07-03T07:00:18Z", "custom_fields": [ { "id": 10, "name": "Overtime", "value": "0" } ] } }