Project

General

Profile

Actions

Defect #29069

open

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

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

Status:
Needs feedback
Priority:
Normal
Assignee:
-
Category:
Time tracking
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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

Actions #1

Updated by Go MAEDA over 5 years ago

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

Actions #2

Updated by Go MAEDA over 5 years ago

  • Status changed from New to Needs feedback
Actions #3

Updated by Ty You over 5 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.

Actions #4

Updated by Go MAEDA over 5 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" 
      }
    ]
  }
}
Actions

Also available in: Atom PDF