Redmine - Feature #38238
Auto watch issues on issue creation
2023-02-03 02:00 - Felix Schäfer

ステータス:

Closed

開始日:

優先度:

Normal

期日:担当者:

Go MAEDA

進捗率:

0%

カテゴリ:

Email notifications

予定工数:

0.00時間対象バージョン:5.1.0

Resolution:

Fixed

説明
Similar to #4347 we propose adding an option to watch issues the user created. This would allow users to more finely control
which issues they want to be notified about rather than having to select the "only owner" or "only my events" and receiving
notifications for all the issues the user created. This will also allow in the future to replace the mail notification options with only
having auto watching options.
関連するチケット:
関連している Redmine - Feature #4347: Contributing to an issue ...

Closed関連している Redmine - Feature #38343: Change the default notif...

Closed2009-12-06

関係しているリビジョン
リビジョン 22115 - 2023-02-26 08:46 - Go MAEDA
Auto watch issues on issue creation (#38238).
Patch by Felix Schäfer.
リビジョン 22116 - 2023-02-26 08:48 - Go MAEDA
Disable auto watch for the anonymous user (#38238).
Patch by Felix Schäfer.
リビジョン 22117 - 2023-02-27 02:51 - Go MAEDA
Update locales (#38238).
リビジョン 22342 - 2023-10-15 03:31 - Go MAEDAFix a test failure due to the auto watch on issue creation (#38238).
Patch by Go MAEDA.
リビジョン 22351 - 2023-10-16 17:16 - Go MAEDA
Revert r22342 as it became unnecessary after the addition of the :user̲preferences fixture to WatcherTest in r22350 (#38238).

履歴#1 - 2023-02-03 02:02 - Felix Schäfer- ファイル 38238.patch を追加
The attached patch adds a new option to auto watch issues the user creates. This option is activated for users that already have the issues
contributed to auto watch option active.
#2 - 2023-02-03 02:03 - Felix Schäfer
Please note there is also a typo in the journal tests:
diff --git a/test/unit/journal̲test.rb b/test/unit/journal̲test.rb
index 511b164153..2368f79656 100644--- a/test/unit/journal̲test.rb+++ b/test/unit/journal̲test.rb@@ -120,7 +120,7 @@class JournalTest < ActiveSupport::TestCase
end2024-09-16

1/2

end+

def test̲create̲should̲add̲wacher
def test̲create̲should̲add̲watcher
user = User.firstuser.pref.auto̲watch̲on=['issue̲contributed̲to']user.save#3 - 2023-02-03 08:03 - Go MAEDA- 対象バージョン を Candidate for next major release にセット
LGTM!
#4 - 2023-02-03 08:03 - Go MAEDA- 関連している Feature #4347: Contributing to an issue should automatically add the user to the watchers list を追加#5 - 2023-02-03 08:12 - Felix Schäfer- ファイル 38238-2.patch を追加
We have noticed an issue when this option is activated and the author adds themself as a watcher to the new issue when creating it. This updated
patch adds a test for this case and fixes this issue.
#6 - 2023-02-10 18:45 - Felix Schäfer
I am sorry for the trouble but we have noticed a lot of issues with the callback structure in the proposed patch. We have reworked the feature to use
a after̲create̲commit callback so that the issue is already saved when the automatic watcher is added and top avoid the issue not getting saved
because of errors in the callbacks. Adding automatic watchers is not a core feature of issues and thus should not block creating the issue.
I will post an updated patch shortly.
#7 - 2023-02-11 22:00 - Felix Schäfer- ファイル 38238-3̲no̲anonymous̲watcher.patch を追加- ファイル 38238-3.patch を追加
Please see the updated attached patch. As previously summarised this removes adding the automatic watcher from the issue transaction so that thisdoes not interfere with creating the issue.
We have also added a patch to never auto watch for the anonymous user. Due to the anonymous getting new UserPreference each time theanonymous user is used the default UserPreference will be used, which includes auto watching new issues and issue edits. This should be fixed witha better UserPreference for the anonymous user, but this is outside the scope of this issue.
#8 - 2023-02-15 12:43 - Go MAEDA- 対象バージョン を Candidate for next major release から 5.1.0 に変更
Setting the target version to 5.1.0.
#9 - 2023-02-26 08:48 - Go MAEDA- ステータス を New から Closed に変更- 担当者 を Go MAEDA にセット
- Resolution を Fixed にセット
Committed the patches. Thank you for your contribution.
#10 - 2023-03-09 10:14 - Go MAEDA- 関連している Feature #38343: Change the default notification option to "Only for things I watch or I am assigned to" を追加

ファイル
38238.patch

4.29 KB

2023-02-03

Felix Schäfer

38238-2.patch

4.75 KB

2023-02-03

Felix Schäfer

38238-3̲no̲anonymous̲watcher.patch

2.71 KB

2023-02-11

Felix Schäfer

38238-3.patch

4.51 KB

2023-02-11

Felix Schäfer

2024-09-16

2/2