Patch #32628

Notify users about high issues (only)

Added by Jan from Planio www.plan.io about 1 month ago. Updated 2 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Email notifications
Target version:4.2.0

Description

This feature introduces a setting in each user's My account section which allows them to select/deselect a new option labeled Also notify me about issues with a priority of high or higher.

If this option is set, users will be notified about issues that have a high priority even if they're not assigned to or watching it.

Currently, I see 2 use cases for this:

  1. Project Management: Higher level project managers who oversee multiple projects and aren't directly involved in the day to day business but want to be in the loop about things that have a high priority.
  2. Help desk: In a help desk or service desk scenario, users may wish to disable all notifications and only work on the ticket queue in Redmine during their work hours. However, if tickets have a high priority, they may want to be notified by email even outside their work hours, when they're not logged in to Redmine.

Considerations:

For this feature, we need a definition of what a "high" priority is, because priorities can be created by Redmine admins. The proposed implementation works akin to the CSS classes of issues (for colouring in some themes) in the issue list. For this, Redmine already computes "position names", e.g. high, high2, highest, etc.

In order to use this mechanism, patch 0002 extracts finding the "middle" priority into its own method, and patch 0003 uses the method to define a is_high? high? helper. A is_low? low? helper is introduced as well for completeness sake and potential future uses.

Finally, patch 0004 introduces the new user preference and the mechanism that sends the notifications.

Tests for all relevant parts are included.

0001-Use-existing-scopes-instead-of-one-off-AR-condition.patch Magnifier (969 Bytes) Jan from Planio www.plan.io, 2020-01-07 06:23

0002-Extract-finding-the-default-or-middle-issue-priority.patch Magnifier (2.58 KB) Jan from Planio www.plan.io, 2020-01-07 06:23

0003-Add-IssuePriority-high-and-low-helpers.patch Magnifier (2.57 KB) Jan from Planio www.plan.io, 2020-01-07 06:23

0004-Enable-users-to-receive-email-notifications-about-hi.patch Magnifier (8.84 KB) Jan from Planio www.plan.io, 2020-01-08 04:57

0005-German-translation-for-high-priority-notification-se.patch Magnifier (1.05 KB) Jan from Planio www.plan.io, 2020-01-08 07:17

Associated revisions

Revision 19446
Added by Go MAEDA 2 days ago

Use existing scopes instead of one-off AR condition (#32628).

Patch by Jan Schulz-Hofen.

Revision 19447
Added by Go MAEDA 2 days ago

Extract finding the default or "middle" issue priority into its own class method (#32628).

Patch by Jan Schulz-Hofen.

Revision 19448
Added by Go MAEDA 2 days ago

Add IssuePriority#high? and #low? helpers (#32628).

Patch by Jan Schulz-Hofen.

Revision 19449
Added by Go MAEDA 2 days ago

Enable users to receive email notifications about high issues (only) (#32628).

Patch by Jan Schulz-Hofen.

Revision 19450
Added by Go MAEDA 2 days ago

Code cleanup: RuboCop: Fix Layout/EmptyLinesAroundMethodBody in test/functional/my_controller_test.rb (#32628).

Revision 19451
Added by Go MAEDA 2 days ago

Code cleanup: RuboCop: Fix Rails/ActiveRecordAliases in test/unit/issue_priority_test.rb (#32628).

Revision 19452
Added by Go MAEDA 2 days ago

German translation for high priority notification setting (#32628).

Revision 19453
Added by Go MAEDA 2 days ago

Update locales (#32628).

History

#1 Updated by Go MAEDA about 1 month ago

Thank you for posting the patches. I like the proposed feature that allows users to more fine-graded control email notifications.

I suggest some trivial improvements:

  • Even if "I don't want to be notified of changes that I make myself" is enabled, notifications about issues with higher priorities are sent. In my opinion, no_self_notified should be prioritized than notify_about_high_priority_issues
  • How about changing the method names "is_high?" and "is_low?" to "high?" and "low?"? Most core methods of Ruby don't have "is_" prefix. I feel the names are a little verbose
  • How about enabling notify_about_high_priority_issues by default? To do so, users will be able to expect that notifications about issues with higher priorities are sent to most members

#2 Updated by Go MAEDA about 1 month ago

  • Target version set to Candidate for next major release

#3 Updated by Jan from Planio www.plan.io 16 days ago

  • File deleted (0003-Add-IssuePriority-is_high-and-is_low-helpers.patch)

#4 Updated by Jan from Planio www.plan.io 16 days ago

  • File deleted (0004-Enable-users-to-receive-email-notifications-about-hi.patch)

#5 Updated by Jan from Planio www.plan.io 16 days ago

  • File deleted (0002-Extract-finding-the-default-or-middle-issue-priority.patch)

#6 Updated by Jan from Planio www.plan.io 16 days ago

  • File deleted (0001-Use-existing-scopes-instead-of-one-off-AR-condition.patch)

#7 Updated by Jan from Planio www.plan.io 16 days ago

Thank you for your feedback!

  • Even if "I don't want to be notified of changes that I make myself" is enabled, notifications about issues with higher priorities are sent. In my opinion, no_self_notified should be prioritized than notify_about_high_priority_issues

I agree and this was already the case. I have now added a test to demonstrate the behaviour. Can you still reproduce this?

  • How about changing the method names "is_high?" and "is_low?" to "high?" and "low?"? Most core methods of Ruby don't have "is_" prefix. I feel the names are a little verbose

Thank you for the suggestion. I have changed it like you proposed.

  • How about enabling notify_about_high_priority_issues by default? To do so, users will be able to expect that notifications about issues with higher priorities are sent to most members

I am not sure if this may confuse existing users. But I agree with your point regarding expectations. I have therefore enabled this by default now.

Please find the new patch series attached.

#8 Updated by Jan from Planio www.plan.io 16 days ago

  • Description updated (diff)

#9 Updated by Jan from Planio www.plan.io 15 days ago

  • File deleted (0004-Enable-users-to-receive-email-notifications-about-hi.patch)

#10 Updated by Jan from Planio www.plan.io 15 days ago

Minor update to patch 0004 which downcases the priority name in the setting label as it is part of a sentence.

#12 Updated by Go MAEDA 15 days ago

Jan from Planio www.plan.io wrote:

  • How about enabling notify_about_high_priority_issues by default? To do so, users will be able to expect that notifications about issues with higher priorities are sent to most members

I am not sure if this may confuse existing users. But I agree with your point regarding expectations. I have therefore enabled this by default now.

I changed my mind after reading the following sentences in https://support.plan.io/news/162. I understood that this feature is not intended to get more emails but to reduce the total amount of emails.

This will essentially notify you about high priority issues regardless of whether they are assigned to you or whether you are watching or being otherwise involved in them. This will also work if you have selected to receive no notifications at all otherwise.

We believe this to be particularly useful for high level managers who are overseeing many projects but aren't directly involved in their day-to-day. It's also great for help desk scenarios where agents won't need email notifications for regular issues as they're working on them consistently following an orderly queue. Yet, high priority issues could now alert them even if they aren't currently logged on or are working on something else – if that's what's desired.

#13 Updated by Go MAEDA 14 days ago

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

Setting the target version to 4.2.0.

#14 Updated by Jan from Planio www.plan.io 14 days ago

Go MAEDA wrote:

I changed my mind after reading the following sentences in https://support.plan.io/news/162. I understood that this feature is not intended to get more emails but to reduce the total amount of emails.

I think one could make an argument for both options. I am happy to alter the patch again, it’s just the three lines in the initializer. Maybe some other folks have feedback on this?

#15 Updated by Go MAEDA 2 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patches. Thank you for improving Redmine.

Jan from Planio www.plan.io wrote:

Go MAEDA wrote:

I changed my mind after reading the following sentences in https://support.plan.io/news/162. I understood that this feature is not intended to get more emails but to reduce the total amount of emails.

I think one could make an argument for both options. I am happy to alter the patch again, it’s just the three lines in the initializer. Maybe some other folks have feedback on this?

For now, I have modified the patch to disable the setting by default. As you mentioned before, it may confuse users.

Also available in: Atom PDF