Defect #29069

API reports wrong date for time spent if issue start date is greater than spent_on date

Added by Ty You over 4 years ago. Updated over 4 years ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:


Category:Time tracking
Target version:-
Resolution: Affected version:3.2.6


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.

Redmine version 3.2.6.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux]
Rails version
Environment production
Database adapter Mysql2
Subversion 1.8.10
Mercurial 3.1.2
Bazaar 2.7.0
Git 2.1.4
Redmine plugins:
no plugin installed


#1 Updated by Go MAEDA over 4 years ago

I could not reproduce the problem. Could you describe detailed steps to reproduce?

#2 Updated by Go MAEDA over 4 years ago

  • Status changed from New to Needs feedback

#3 Updated by Ty You over 4 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.

#4 Updated by Go MAEDA over 4 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" 

Also available in: Atom PDF