Project

General

Profile

Activity Report is missing much information for issues

Added by Gary Aitken 9 days ago

One can see a display of recent activity by doing the following:

Projects
  click a particular project
    click "Activity" (2nd tab)

Unfortunately, many modifications to an issue do not show up:

*only* modifying the description
*only* adding or deleting an attachment
*only* editing an existing note (as opposed to adding a new note)

The following modifications do show up:

Adding a new issue
Anything where a note was added
Modifying only the status

I have not yet checked the following:

*only* changing priority
*only* changing tracker
*only* changing parent
*only* changing assignee
*only* changing estimated time
*only* changing %done

This appears to be a result of the following phrase in the sql query which gets executed:

(journal_details.prop_key='status_id' or journals.notes <> '')

The value of prop_key may be something like "description" or a number like 140nn (for attachments).
"status_id" is the value of prop_key when the status is changed.
So it looks like it is only showing activity where the status of an issue was changed or a note was added (along with other possible modifications).
Is this intentional?
It seems to me one should see an entry for any modifications to an issue.
A refinement would be to be able to select which modifications show up.

I'm observing this in :

Environment:
  Redmine version                5.1.9.stable
  Ruby version                   3.2.3-p157 (2024-01-18) [x86_64-linux]
  Rails version                  6.1.7.10
  Environment                    redmine_only_test
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                sendmail
Redmine settings:
  Redmine theme                  Xblgx_test
SCM:
  Subversion                     1.14.3
  Git                            2.43.0
  Filesystem                     
Redmine plugins:
  no plugin installed

Replies (3)

RE: Activity Report is missing much information for issues - Added by Gary Aitken 4 days ago

The following changes, by themselves, are reported / not reported:

Only issue description changed        Not reported
Only an attachment added              Not reported
Only an attachment deleted            Not reported
Only status changed                   Reported
Only priority changed                 Not reported
Only tracker changed                  Not reported
Only parent changed                   Not reported
Only assignee changed                 Not reported
Only estimated time changed           Not reported
Only % done changed                   Not reported
Only note added                       Reported (New Note)
Only note edited/changed              Not reported (changed Note)
Only comment (w/time,activity) added  Not reported

RE: Activity Report is missing much information for issues - Added by Gary Aitken 4 days ago

This appears to be a very old issue, see #8889

RE: Activity Report is missing much information for issues - Added by Gary Aitken 4 days ago

Much of the missing activity can be added by making a change to app/models/journal.rb:
approximately line 59, change:

" (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')").distinct

to something like:

where("#{Journal.table_name}.journalized_type = 'Issue' AND" 
" (#{JournalDetail.table_name}.prop_key = 'status_id' OR \
#{JournalDetail.table_name}.prop_key = 'description' OR \
#{JournalDetail.table_name}.prop_key = 'child_id' OR \
#{JournalDetail.table_name}.prop_key = 'tracker_id' OR \
#{JournalDetail.table_name}.prop_key = 'priority_id' OR \
#{JournalDetail.table_name}.prop_key = 'parent_id' OR \
#{JournalDetail.table_name}.prop_key = 'assigned_to_id' OR \
#{JournalDetail.table_name}.prop_key = 'estimated_hours' OR \
#{JournalDetail.table_name}.prop_key = 'done_ratio' OR \
#{JournalDetail.table_name}.prop_key REGEXP '[0-9]
' OR \
#{Journal.table_name}.notes <> '')").distinct

or, assuming everything is desired:

where("#{Journal.table_name}.journalized_type = 'Issue' AND" +
" (#{JournalDetail.table_name}.prop_key <> '' OR \
#{Journal.table_name}.notes <> '')").distinct

The field "prop_key" in journal_details is simply a string, so plugins can add all sorts of things there.
I suspect this is part of the rails journaling API.

The set of unique prop_key fields not including attachment numbers can be obtained as follows. Note that these are only the keys that have actually been used; there does not appear to be a table containing the set of possible keys.
```
mysql> SELECT DISTINCT prop_key FROM journal_details WHERE prop_key REGEXP '[a-z,_]+';
```
A proper solution to this would be a table containing the used keys which is somehow updated (it could be initially generated at startup, with some pre-seeded entries), and then adding (sub)Settings for Activity for Issues to select which things get reported.
journal.rb would then generate the appropriate phrases for the selected issue components of interest.

    (1-3/3)