Feature #4138

Add spent time comments in search

Added by Spyros Oikonomopoulos about 8 years ago. Updated almost 4 years ago.

Status:NewStart date:2009-10-29
Priority:NormalDue date:
Assignee:Mischa The Evil% Done:

0%

Category:Search engine
Target version:Candidate for next minor release
Resolution:

Description

Hello,

we are using the "log time" function extensively for reporting activities related to long running issues. However "spent time" comments are not included in searches. Can they be added?

Thanks in advance

Related issues: #3082 #3936

rm4138-make_time_entries_searchable-trunk_12160.diff Magnifier (1.42 KB) Mischa The Evil, 2013-09-24 22:55

rm4138-make_time_entries_and_their_custom_fields_searchable-trunk_r12406.diff Magnifier (7.26 KB) Mischa The Evil, 2013-12-16 11:48


Related issues

Related to Redmine - Feature #992: Option to search open issues only Closed 2008-04-04
Related to Redmine - Feature #3082: Repository Search New 2009-03-31
Duplicated by Redmine - Feature #9063: Searchable comments from "Log time" Closed 2011-08-16
Duplicated by Redmine - Feature #13693: Possibility to search in time log comments Closed

History

#1 Updated by Jean-Philippe Lang about 8 years ago

  • Category set to Search engine

#2 Updated by snow windwaves over 6 years ago

+1. I log all my time for invoicing and have lots comments to back up my bills. it would be great to be able to search them

#3 Updated by Jamie Gruener over 6 years ago

+1

We use Redmine time entry comments for invoices, too, and being able to search comments would be a real help.

#4 Updated by Alexander Bagiev over 4 years ago

+1
Since spent hours are associated with comments, we fill this field instead of notes, but cannot search.

#5 Updated by Mischa The Evil about 4 years ago

  • Duplicated by Feature #9063: Searchable comments from "Log time" added

#6 Updated by Mischa The Evil about 4 years ago

I have created a rough patch, against Redmine trunk at r12160, that should provide this feature.

Known issues:
  • shown search results display created_on date of time entry comments instead of date from :date
  • time entry comments should be ordered by :date instead of :created_on (but can not because it is a date column)
  • no tests added yet

#7 Updated by Karl Fenech about 4 years ago

Hi,
im new to this, can anyone let me know how patch can be installed?

Thanks in advance

#8 Updated by Karl Fenech about 4 years ago

Managed to run the patch but am getting the following:

bitnami@linux:/opt/bitnami/apps/redmine$ patch p0 < rm4138.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
-------------------------
|Index: lib/redmine.rb |=================================================================== |--- lib/redmine.rb (revision 12160) |+++ lib/redmine.rb (working copy)
--------------------------
File to patch:

Am i running the patch in the correct folder? How should i proceed?

#9 Updated by Mischa The Evil about 4 years ago

Karl Fenech wrote:

bitnami@linux:/opt/bitnami/apps/redmine$ patch p0 < rm4138.diff
...
Am i running the patch in the correct folder? How should i proceed?

No, that is not the correct directory. It should be the top directory where Redmine source files are stored (a.k.a. the RAILS_ROOT or REDMINE_ROOT). It is {BITNAMI_DIR}/apps/redmine/htdocs for BitNami Redmine deployments1.

1 according to http://bitnami.com/stack/redmine/README.txt

#10 Updated by Karl Fenech about 4 years ago

Thanks, update worked.
I can now search for comments from the overall time spent under a project and is working fine. only thing that did not work is that comments cannot be searched using the search button top right, is this expected?

#11 Updated by Toshi MARUYAMA about 4 years ago

  • Related to Feature #992: Option to search open issues only added

#12 Updated by Toshi MARUYAMA about 4 years ago

#13 Updated by Mischa The Evil about 4 years ago

  • Assignee set to Mischa The Evil
  • Target version set to Unplanned

I'll schedule some time to work on this issue to come up with a usable and tested (!) patch.

Karl Fenech wrote:

Thanks, update worked.
I can now search for comments from the overall time spent under a project and is working fine. only thing that did not work is that comments cannot be searched using the search button top right, is this expected?

No, it is not. I think the behavior you are experiencing is caused by other search variables. Though, I haven't tested the patch I posted well enough yet to be certain of that. To be continued...

Mischa The Evil wrote:

  • shown search results display created_on date of time entry comments instead of date from :date
  • time entry comments should be ordered by :date instead of :created_on (but can not because it is a date column)

A second look at the core code has left me in doubt if these two issues really are issues because the same created_on is already used/displayed in the activity view (r2877). Any suggestions on this are welcome...

#14 Updated by Mischa The Evil almost 4 years ago

  • Duplicated by Feature #13693: Possibility to search in time log comments added

#15 Updated by Mischa The Evil almost 4 years ago

I continued working on this issue and have come up with a new, extended and thoroughly tested patch against Redmine trunk at r12406. It turns out that the patch I posted earlier in note-6 was already fully functional and bug-free. The changes between that patch and the new patch I'll upload here are:
  1. added three tests to search_controller_test1 (including pulling-in the required time_entries fixtures) and one to timelog_controller_test2 to make sure the new TimeEntry comments searching functionality works correctly in all the cases
  2. fixed two assertions in SearchControllerTest#test_search_all_projects that broke due to the fact that issue 2 has now been pushed to the second page of the search results
  3. added additional functionality to also search TimeEntry custom field values (this seems a logic next step now that TimeEntry comments can be searched)
  4. added yet another test (with accompanying custom field and custom value fixtures) to search_controller_test3 to make sure that TimeEntry custom field value searching is working correctly

I tried to separate the patch into two dedicated patches, but this wasn't possible because of the test changes that are in the same file.

Please let me know if something else is needed to get these features integrated. Regarding the "issues" with the dates that are used to sort and display the search results that I mentioned earlier in note-6 and note-13: I stick to my previous conclusion that it is not a real issue. Though, it might be something that could be improved in the future (maybe we can change the event title to also include the date of the time entry?), but I don't think that something like that should block the possible integration of these features.

Disclaimer: the patch currently breaks an existing unit test (ProjectTest#test_destroying_root_projects_should_clear_data), but this is caused by a defect in the Redmine core instead of a bug in the functionality provided by the patch. See #15709.

1 SearchControllerTest#test_search_time_entries_on_project, SearchControllerTest#test_search_time_entries_on_project_with_subprojects_scope and SearchControllerTest#test_search_time_entries_on_all_projects.

2 TimelogControllerTest#test_default_search_scope

3 SearchControllerTest#test_search_time_entries_with_searchable_custom_fields

Also available in: Atom PDF