Project

General

Profile

Actions

Feature #1766

closed

Custom fields should become addable to Spent Time list/report

Added by Mischa The Evil over 16 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Time tracking
Target version:
Start date:
2008-08-11
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Like the subject states timelog.custom_field columns should become addable to the reports @ /projects/xxxprojectxxx/timelog/details.

They are available already as filters in the 'Spent Time'-report view.


Files

a.png (28.5 KB) a.png Felix M, 2015-07-15 18:00
b.png (29.7 KB) b.png Felix M, 2015-07-15 18:00

Related issues

Related to Redmine - Feature #1692: Enable time-tracking additional fields in reports filtersNew2008-07-28

Actions
Related to Redmine - Patch #3117: Add the possibility to select the comment field to /timelog/reportNew2009-04-03

Actions
Related to Redmine - Patch #4705: Allow selection of up to five fields in timelog reportNew2010-02-01

Actions
Related to Redmine - Feature #6972: Custom fields in timelog reportClosed2010-11-24

Actions
Related to Redmine - Feature #21061: Custom Field for Spent timeClosed

Actions
Related to Redmine - Feature #25773: Add more custom fields types to criteria in time entries reportNew

Actions
Has duplicate Redmine - Feature #6797: custom fields missing in time detailClosed2010-11-02

Actions
Has duplicate Redmine - Feature #7634: Report on project custom field in time spent reportClosed2011-02-16

Actions
Actions #1

Updated by Daniel N over 16 years ago

This would greatly improve the usability of the timelog feature. I also noticed that only "boolean"-type custom fields appear as filter in the drop-down for Spent Time reports. Could you confirm this? Or do all your custom fileds are available?

Actions #2

Updated by Daniel N over 16 years ago

Duplicates #1692 - Jean-Philippe explained that currently only bolean and list types are available.

Actions #3

Updated by Mischa The Evil over 16 years ago

I took the liberty to follow-up the discussion of this issue on the forums to keep the issue as concrete as possible... :-)

Actions #4

Updated by Frédéric Moulins almost 15 years ago

The following patch allows to add comments to the list of fields : #3117.

To add up to 5 fields to the report : #4705.

Custom fields are already available, so the feature should be complete.

Actions #5

Updated by Maciej Czub over 13 years ago

There are many gaps (mainly in the aspects of custom_fields) in the functionality of:
  • /projects/foo/timelog/details
  • /projects/foo/timelog/report
  • /time_entries
  • /time_entries/report

Key function is to display the custom fields in the detailed views and reports. It's now only partially implemented in the timelog CSV export feature. There are also requests for filtering by custom fields in details and grouping by custom fields in reports.

It would be nice if these gaps in functionality have been filled.

Actions #6

Updated by Jamie Gruener over 13 years ago

Just to be clear, only some types of custom fields are available in the Report view. Specifically, text fields are not available, and I understand why, but that doesn't help folks who would like to see the data in Redmine (I stopped using Excel for a reason, folks!). Ideally, you could add additional fields to the Details view.

Actions #7

Updated by Fabio Ginzel over 13 years ago

+1

Actions #8

Updated by Jérôme BATAILLE over 13 years ago

+1

Actions #9

Updated by Sergey Startsev over 12 years ago

Still waiting for the solution!
For example, the is no text field for a really full report and this is why I created a custom one. But to view this mostly meaningful for me information, I must go to the report editing page - anoing thing.

Actions #10

Updated by Gabriel Pettier over 12 years ago

I did a patch to my redmine instance to allow Project custom fields (string and bool), it was done on an older version of redmine, i put it in the last git, but untested on this version.

https://github.com/tshirtman/redmine/commit/257b08e1359a19bc70cc555fdc7b8c6b8d842743

Actions #11

Updated by Kelly Goedert over 12 years ago

+1

Actions #12

Updated by Fernando Silveira over 12 years ago

+1

Actions #13

Updated by Bo Hansen over 12 years ago

  • Assignee set to Jean-Philippe Lang

Could not get Gabriel's patch to work on 2.0.3, but here's one adding custom project fields of type list and bool to the time report view:

index 80e6052..28c2ed8 100644
--- a/lib/redmine/helpers/time_report.rb
+++ b/lib/redmine/helpers/time_report.rb
@@ -157,6 +157,13 @@ module Redmine
                                                  :label => cf.name}
         end

+        # add project custom fields
+        ProjectCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
+          @available_criteria["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'Project' AND c.customized_id = #{TimeEntry.table_name}.project_id ORDER BY c.value)", 
+                                                 :format => cf.field_format,
+                                                 :label => cf.name}
+        end
+
         @available_criteria
       end
     end

This patch is actually well in line with issue #8161 adding project custom fields for issue queries. Could this patch go into the upcoming 2.1 release?

Best regards,
Bo

Actions #14

Updated by Rami Sedhom over 12 years ago

+1

Actions #15

Updated by Robert Barnebeck over 12 years ago

+1 It would be great to have the ability to show custom time entry fields in the Spent Time Details list!

Actions #16

Updated by Jean-Philippe Lang about 12 years ago

  • Target version set to 2.3.0
Actions #17

Updated by Bob Pack almost 12 years ago

Will this change also include Issue custom fields? This would make a great difference for my company.

If you need a use-case, consider this organization, which seems like it should be somewhat common and very powerful- we have issues/tasks that are organized according to component. The components (projects) are a flat list. We then get paid to make specific updates to different components, depending on the customers' needs/wants. So, a particular customer may want Components A,B, and C to get updated, with changes identified in Tasks X,Y,Z (members of A,B, and C respectively). That is a simple case, because of course there are many components, and many tasks, and many customers, but you should see where I'm going. It's very useful (and important) for me to be able to go to the Spent Time Report and identify what work was done for a particular customer on a particular contract. I can't do that today. ALSO, please note: I don't want my employees to enter the contract/client on their spent time report- I specifically want this data to be entered during the planning phase as a custom field on the issue, so upper management can have visibility to progress through the "All Issues" querying system. I have a different system to track time spent on contracts.

Actions #18

Updated by Marc Neeley almost 12 years ago

+1 in what Bob Pack is saying here. I too see requests by external customers and internal managers wanting to see Estimated Time and % Complete shown next to Spent Time in the reports. This essentially becomes the Gantt in report form rather than graphic form. They are already seeing issues in the reports, just not various key fields.

Actions #19

Updated by Jean-Philippe Lang almost 12 years ago

Bob Pack wrote:

Will this change also include Issue custom fields?

You will be able to filter the spent time list/report by issue custom fields.

Actions #20

Updated by Jean-Philippe Lang almost 12 years ago

Issue custom fields are now available as columns in spent time details (r11174).

Actions #21

Updated by Bo Hansen almost 12 years ago

Looks good in current trunk - much requested feature to get the filters in the report view.
Any chance to see the project custom fields added to the list of columns also?

Thanks in advance,
Bo

Actions #22

Updated by Daniel Felix almost 12 years ago

Bo Hansen wrote:

Any chance to see the project custom fields added to the list of columns also?

This is also requested in another issue #1766.

Actions #23

Updated by Bob Pack almost 12 years ago

Thanks for the work on this feature! It will be a huge help, and you can bet that as soon as 2.3 is released I will be upgrading. I may try out the trunk for the first time based on our need for this. This gives me another dimension to sort the data over, which I sorely have needed.

Marc Neeley wrote:

+1 in what Bob Pack is saying here. I too see requests by external customers and internal managers wanting to see Estimated Time and % Complete shown next to Spent Time in the reports. This essentially becomes the Gantt in report form rather than graphic form. They are already seeing issues in the reports, just not various key fields.

Marc - you are saying something slightly different from what I was saying. I was talking specifically about Custom Fields, and you are talking about built-in Issue fields. I can see some value in what you are saying, although I'm not sure it will work exactly as you want. Personally, I'd like to see an interface where I can look at the projected work for the month (factoring in "Estimated Time" on a month basis, similar to how it's done in Spent Time reports). Maybe that's what you want too? It won't work that way in the current structures, though, because Spent Time will only report on items that have had time spent on them (of course).

If that isn't your goal, maybe adding "Estimated Time" and "% Complete" in the "Overall Issues" filter view will give you some of you want.

Actions #24

Updated by Bo Hansen almost 12 years ago

Updated patch for project custom fields in the criteria list for reports (merely an offset change, applies to 11447):

index 4798fe6..0615314 100644
--- a/lib/redmine/helpers/time_report.rb
+++ b/lib/redmine/helpers/time_report.rb
@@ -141,6 +141,13 @@ module Redmine
                                                  :label => cf.name}
         end

+        # add project custom fields
+        ProjectCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
+          @available_criteria["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'Pr
+                                                 :format => cf.field_format,
+                                                 :label => cf.name}
+        end
+
         @available_criteria
       end
     end

Much appreciated if it makes it into 2.3.0.

/Bo

Actions #25

Updated by Jean-Philippe Lang almost 12 years ago

  • Subject changed from Timelog custom-field columns should become addable to 'Spent Time'-details report. to Custom fields should become addable to Spent Time list/report
  • Status changed from New to Closed
  • Resolution set to Fixed

Bo Hansen wrote:

Updated patch for project custom fields in the criteria list for reports (merely an offset change, applies to 11447):
[...]

Much appreciated if it makes it into 2.3.0.

Project custom fields added to the spent time report in r11459.

Actions #26

Updated by Bo Hansen almost 12 years ago

Thanks a lot, it's working nicely on trunk. Looking forward to next release :)

/Bo

Actions #27

Updated by delfo esposito over 11 years ago

hi guys

is this true only for project's custom fields of type list?
i don't see my project custom fields of type TEXT in the options for time spent report

thanks

Delfo

Actions #28

Updated by Sergey Startsev over 11 years ago

it's true for every type of fcustom field.
For example, we use TEXT field for additional comments to a reports.

Actions #29

Updated by delfo esposito over 11 years ago

more details about my issue:
Report working:

/projects/cdgprojects/time_entries/report?utf8=%E2%9C%93&criteria[]=project&period_type=2&from=2013-06-01&to=2013-06-26&columns=month&criteria[]=cf_99

where cf_99 is type LIST

if i use cf_100 which is TEXT it is just ignored

anything in global settings to set maybe?

Actions #30

Updated by Joel SCHAAL over 10 years ago

It seems I do not see our custom field (of type Integer) in the details of the time entries (when I access /projects/foo/issues/42/time_entries)
Did I miss something in my configuration (/ how I use this feature) or has there been a regression on this topic since 2.3.0 ?

Actions #31

Updated by Felix M over 9 years ago

I agree with Joel: If this was working in 2.3.0, then there has been a regression.
I'm using 3.0.3.stable, and I'm trying to add an Issue's Custom Field of type text (called PSP) to the time report (time_entries/report).

It's possible to filter by my custom field:

But I can't add my custom field (of type text) to the report:

Actions #32

Updated by Felix M over 9 years ago

I get the desired behavior (i.e. add a string custom field to the report) if I make the following changes:

in lib/redmine/field_format.rb, in class StringFormat add:
def group_statement(custom_field)
order_statement(custom_field)
end

in lib/redmine/helpers/time_report.rb
change custom_fields.select {|cf| %w(list bool string).include?(cf.field_format) && !cf.multiple?}.each do |cf|
to custom_fields.select {|cf| %w(list bool).include?(cf.field_format) && !cf.multiple?}.each do |cf|

But I don't understand why only list and bool had group_statement in field_format.rb and were treated differently in time_report.rb. Does my change have any unforseen consequences?

Actions #33

Updated by Toshi MARUYAMA over 9 years ago

Felix M wrote:

I get the desired behavior (i.e. add a string custom field to the report) ...

I don't know it is related or not, I created issue #19121.

Actions #34

Updated by James Vreeken about 9 years ago

I am also having this problem... we have a custom field called "Job Number" we would like to be able to create a report thru the tool that exports the week with time spent along with the job number... Its not working...

I tried what Felix M said to do by editing
lib/redmine/field_format.rb and lib/redmine/helpers/time_report.rb but I still can't get custom fields to show up in the list on the report tab...

Actions #35

Updated by Toshi MARUYAMA about 9 years ago

Actions #36

Updated by Mischa The Evil over 7 years ago

  • Related to Feature #25773: Add more custom fields types to criteria in time entries report added
Actions

Also available in: Atom PDF