Project

General

Profile

Actions

Feature #4138

open

Add spent time comments in search

Added by Spyros Oikonomopoulos over 14 years ago. Updated over 2 years ago.

Status:
Needs feedback
Priority:
Normal
Assignee:
-
Category:
Search engine
Start date:
2009-10-29
Due date:
% Done:

0%

Estimated time:
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


Files


Related issues

Related to Redmine - Feature #992: Option to search open issues onlyClosedJean-Philippe Lang2008-04-04

Actions
Related to Redmine - Feature #3082: Repository SearchNew2009-03-31

Actions
Has duplicate Redmine - Feature #9063: Searchable comments from "Log time"Closed2011-08-16

Actions
Has duplicate Redmine - Feature #13693: Possibility to search in time log commentsClosed

Actions
Has duplicate Redmine - Defect #36059: Fulltext search in timelog commentsNew

Actions
Actions #1

Updated by Jean-Philippe Lang over 14 years ago

  • Category set to Search engine
Actions #2

Updated by snow windwaves almost 13 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

Actions #3

Updated by Jamie Gruener over 12 years ago

+1

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

Actions #4

Updated by Alexander Bagiev almost 11 years ago

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

Actions #5

Updated by Mischa The Evil over 10 years ago

  • Has duplicate Feature #9063: Searchable comments from "Log time" added
Actions #6

Updated by Mischa The Evil over 10 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
Actions #7

Updated by Karl Fenech over 10 years ago

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

Thanks in advance

Actions #8

Updated by Karl Fenech over 10 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?

Actions #9

Updated by Mischa The Evil over 10 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

Actions #10

Updated by Karl Fenech over 10 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?

Actions #11

Updated by Toshi MARUYAMA over 10 years ago

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

Updated by Toshi MARUYAMA over 10 years ago

Actions #13

Updated by Mischa The Evil over 10 years ago

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

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...

Actions #14

Updated by Mischa The Evil about 10 years ago

  • Has duplicate Feature #13693: Possibility to search in time log comments added
Actions #15

Updated by Mischa The Evil about 10 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

Actions #16

Updated by Marius BĂLTEANU about 6 years ago

+1

Having the possibility to search in spent time comments will be very useful.
Mischa The Evil, do you have the time to update your patch in order to apply cleanly on the current trunk? If not, I can take a look in the next period.

Actions #17

Updated by Mischa The Evil about 6 years ago

Marius BALTEANU wrote:

Mischa The Evil, do you have the time to update your patch in order to apply cleanly on the current trunk? If not, I can take a look in the next period.

I'll see what I can do. Though, feel free to 'take over'. It doesn't seem too much of a work. It is mostly the tests that needs some rewrites (remove the use of assigns and, whenever possible, the fixture additions).

Actions #18

Updated by Mischa The Evil over 2 years ago

Here's an updated patchset against source:/trunk@21200 as a continuation of the patches provided in note#6 and note#15.

Changes compared to the patch provided in note#15:
  • Patch: split-up the patch into atomic commits.
  • Feature: added additional support for searching time entries by their 'hours' and 'spent_on' attributes (along with their 'comments' attribute and their custom field values).
  • Implementation: added association preloading.
  • Implementation: rewritten test coverage using assert_select and added new tests for the added features.
Some notes about the patch transported from note#15:
  • It was needed to fix some assertions in SearchControllerTest#test_search_all_projects that broke due to the fact that issue 'Feature #2' has now been pushed to the second page of the search results.
  • The date that is used to sort and display the search results is the 'created_on' date and not the 'date' date.
  • It adds new custom_fields and custom_values test fixtures for a searchable time entry custom field.

Please review, especially the code implementing the querying of the DB, thoroughly.

Actions #19

Updated by Mischa The Evil over 2 years ago

  • Status changed from New to Needs feedback
Actions #20

Updated by Marius BĂLTEANU over 2 years ago

  • Target version changed from Candidate for next minor release to Candidate for next major release

Thanks Misha for working on this.

Mischa The Evil wrote:

  • Feature: added additional support for searching time entries by their 'hours' and 'spent_on' attributes (along with their 'comments' attribute and their custom field values).

Searching in 'comments' and 'custom field value' is useful, for sure, but I'm not sure what to say about 'hours' and 'spent_on' because I don't see a real use case. 'spent_on' could be quite confusing because it accepts only the database format (yyyy-mm-dd) and some users are used to use the localization format (for ex: dd-mm-yyyy). I'm in favour of extracting the 'hours' and 'spent_on' to another ticket to get more feedback.

Also, I think it's important to check the impact on the application performance because on some instances, the time entries table can be bigger than the issue table (an issue tends to have more time entries).

Actions #21

Updated by Mischa The Evil 4 months ago

  • Has duplicate Defect #36059: Fulltext search in timelog comments added
Actions

Also available in: Atom PDF