Feature #5303

Add spent_hours to /issues/index API

Added by Alex Last almost 13 years ago. Updated over 1 year ago.

Status:ClosedStart date:2010-04-13
Priority:NormalDue date:
Assignee:-% Done:


Category:REST API
Target version:-


I'm trying to import redmine tasks into Microsoft Project through REST API.
I need "time spent" info for tasks to update the remaining time properly in MSP plan.

can we add the corresponding API ?

Related issues

Related to Redmine - Defect #18943: REST API does not return spent_hours when listing issues Closed
Duplicates Redmine - Feature #34857: Add total estimated hours, spent hours, total spent hours... Closed


#1 Updated by Alex Last almost 13 years ago

I haven't looked at the redmine database structure, but I believe adding this info into basic/default data packet sent by Redmine REST API can slow down the system because it would require SQL select from several tables.

maybe we could introduce a special parameter for REST API to indicate that additional info should be added to the data structure? this way we can keep the default data format intact and only add extra fields (by running more expensive SQL queries) only when needed

#2 Updated by Jean-Philippe Lang almost 13 years ago

spent_hours is already present in /issues/1.xml

#3 Updated by Alex Last over 12 years ago

Jean-Philippe, is there a way to add that information to "issues list" response as well (let's say, if some additional parameter is provided in the request). The reason I'm asking about this - it would be very ineffective to load data from Redmine to an external system (like Microsoft Project ) this way. If I export 500 tasks, I'd have to perform 500 additional requests to get the "time spent" info for every task being exported.

I'm currently working on a system, which automatically generates Microsoft Project (MSP) files from the real data stored in Redmine. This way we can reuse all possible reports provided by MSP.

#4 Updated by Jean-Philippe Lang about 12 years ago

  • Subject changed from get "time spent" info through REST API to Add spent_hours to /issues/index API

#5 Updated by Maxim Zyukin almost 11 years ago

I'm working with Alexey on the system.
And one of our customers asked for this ability.

Could you, plz, implement this feature?

#6 Updated by Ivan Cenov almost 10 years ago

Do you need this: http://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries
If so, I think this issue could be closed.

#7 Updated by Daniel Felix almost 10 years ago

  • Due date set to 2013-03-31
  • Status changed from New to Needs feedback

Please give some Feedback if note 6 solves your problem/if everything is fine.
Please give some feedback in the next 14 days. Otherwise this issue will be closed. Thanks.

#8 Updated by Alex Last almost 10 years ago

no, the point was to include time info into "get issues" response so that the client code won't need to perform dozens or hundreds of extra requests after receiving a list of issues. we already implemented the import, so I don't really care that much.

#9 Updated by Daniel Felix almost 10 years ago

  • Due date deleted (2013-03-31)
  • Status changed from Needs feedback to New

I'm removing due date as this one still needs some further investigation.

#10 Updated by David Lukas Müller over 9 years ago

I think, I've observed the same phenomenon:
  • When selecting issues via a query like this http://myhost/redmine/issues.json?cf_7=42, the spent_hours information is missing
  • But wenn I ask for a single issue details directly via http://myhost/redmine/issues/1234.json, the spent_hours information is provided

I'm using Redmine version 2.3.1.stable on Ruby version 1.9.3 (x86_64-linux) with Rails version 3.2.13 (Database adapter Mysql2).

Beside some other plugins, I'm using "redmine_spent_time 2.5.0"

#11 Updated by Toshi MARUYAMA almost 8 years ago

  • Related to Defect #18943: REST API does not return spent_hours when listing issues added

#12 Updated by Go MAEDA over 1 year ago

  • Duplicates Feature #34857: Add total estimated hours, spent hours, total spent hours for issues to issue list API added

#13 Updated by Go MAEDA over 1 year ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

It has been implemented by #34857 and will be available in Redmine 5.0.0.

Also available in: Atom PDF