https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-01-02T15:08:27ZRedmineRedmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=133932010-01-02T15:08:27ZFelix Schäfer
<ul></ul><p>There's already a FR for this at <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Ability to assign issues to groups (Closed)" href="https://www.redmine.org/issues/2964">#2964</a>, as well as some discussion regarding this.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=133942010-01-02T15:14:31ZMichael Ruder
<ul></ul><p>Not exactly, <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Ability to assign issues to groups (Closed)" href="https://www.redmine.org/issues/2964">#2964</a> is about assigning the issue to multiple users. I read the discussion about it. Right now, there can be only one asignee of an issue and having suddenly several raises indeed some questions.</p>
<p>With observers, there is already the option to add multiple to one issue. My request is about being able not only to add users as observers but entire groups. We often have support issues which several employees of our customer want to follow. Adding them one by one to each issue is a bit of a hassle. I would like to be able to just create a group and add this group as observer.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=133952010-01-02T16:34:40ZFelix Schäfer
<ul></ul><p>Michael Ruder wrote:</p>
<blockquote>
<p>Not exactly, <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Ability to assign issues to groups (Closed)" href="https://www.redmine.org/issues/2964">#2964</a> is about assigning the issue to multiple users.</p>
</blockquote>
<p>Oh, sorry, I misread that you wanted to assign an issue to a group, not make a group observe an issue. My bad.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=136012010-01-15T17:09:25ZEric Davis
<ul><li><strong>Subject</strong> changed from <i>Allowing to add user groups as observers for issues</i> to <i>Allowing to add user groups as watchers for issues</i></li><li><strong>Category</strong> changed from <i>Groups</i> to <i>Issues</i></li></ul><p>+1 I would expect they would be added and removed as a group as opposed to adding them as a group and having to remove each member.</p>
<p>Example:</p>
<ul>
<li>Add GroupA - (Developer1 and Developer2)</li>
<li>Remove GroupA</li>
</ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=138542010-01-27T16:22:24ZPavel Smirnov
<ul></ul><p>this is is think is a really good idea, will save a lot of time</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=138552010-01-27T16:29:38ZAlain V.
<ul></ul><p>I think also this a good idea, will help us a lot!<br />I vote for this! +1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=155932010-04-01T14:04:49ZSerge Kosse
<ul></ul><p>I join and vote too.<br />Very necessary functional, IMHO</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=186402010-07-23T19:29:42ZEnrique Delgado
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=187412010-07-27T11:02:41ZMarcelo Fernandes
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=187542010-07-27T12:35:39ZNicholas Kulikov
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=194022010-08-16T06:46:57ZNovikov Igor
<ul></ul><p>Would be very functional, will really reduce timecost for big projects... +1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=206252010-09-23T09:02:47ZMilan Stastny
<ul></ul><p>got this request as issue in our company. Gonna try to make it as a plugin, when done i'll post it here.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=216232010-10-21T15:49:59ZMilan Stastny
<ul></ul><p>Got this done as a plugin(It is on a <a href="http://www.redmine.org/wiki/redmine/Plugin_List#Watcher-Sellection-by-Role" class="external">Plugin Page</a>) so you are free to check it out.</p>
<p>We decided to do it by Roles, they are easier to modify and can be assigned per Project per User.<br />It Adds new Permission to the roles page <em>Display in selection</em> so when this is checked and there are some users in this role on that project, it shows in the list.</p>
<p>Also added Sellect All and Unsellect all buttons.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=302322011-06-25T06:55:50ZStéphane Gourichon
<ul></ul><ul>
<li>+1.</li>
<li>Difference between <a href="http://www.redmine.org/plugins/watcher_sellection_by_role" class="external">Watcher Selection by Role</a> and <a href="http://www.redmine.org/plugins/watcher_sellection_by_group" class="external">Watcher Selection by Group</a> seems interesting. Thank you Milan.</li>
<li>Compatibility with versions above 1.0 is untested. Is there any risk in testing ? If trying features on a local copy of my Redmine 1.2 production setup seems to work, is there any risk in pushing that to actual production ?</li>
</ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=364152012-03-01T08:14:02Zxianguo wei
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=435442012-12-19T12:29:25ZM. K.
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=436172012-12-24T12:12:46ZArthur Zalevsky
<ul></ul><p>"almost 3 years". But feature is really worth to be done. So +1.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=437862013-01-05T03:41:30ZHU an
<ul></ul><p>Badly need this great feature for big project! +1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=448362013-01-22T10:59:11ZMaik Lindner
<ul></ul><p>+1 this feature would be really helpful!</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=452832013-02-05T14:27:46ZFred Giusto
<ul></ul><p>+1 very useful</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=456932013-02-14T15:36:33ZDavy Tielens
<ul></ul><p>+1 It would really speed up our ticket creation.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=459182013-02-20T06:37:08ZYuu YAMASHITA
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=459442013-02-21T08:22:53ZYuu YAMASHITA
<ul></ul><p><a href="http://www.redmine.org/plugins/watcher_sellection_by_group" class="external">Watcher Selection by Group</a> does not work expectedly on my installation of Redmine 2.2.</p>
<p>I wrote my edition of similar plugin which helps checking watchers by their group. Not yet well tested, but it's working on my Redmine 2.2.</p>
<p><a class="external" href="http://www.redmine.org/plugins/watcher_groups">http://www.redmine.org/plugins/watcher_groups</a></p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=471062013-03-20T01:15:12ZDeoren Moor
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=471592013-03-20T15:27:02ZK. F.
<ul></ul><p><a class="external" href="http://www.redmine.org/plugins/redmine_watcher_groups">http://www.redmine.org/plugins/redmine_watcher_groups</a> - in difference from other solutions, with this plugin notifications are sent to current group members.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=472402013-03-21T14:12:24ZDipan Mehta
<ul></ul><p>+1. This is necessary.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=543162014-01-15T23:11:06ZAnonymous
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=547502014-02-08T18:37:07ZEugene B
<ul></ul><p>+1</p>
<p>When I have to add 1-2 observers its ok. When I need to add a department which is ~10-15 users and is already at one group this becomes really useful.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=549402014-02-20T13:08:51ZVaclav Tůma
<ul></ul><p>K. F. wrote:</p>
<blockquote>
<p><a class="external" href="http://www.redmine.org/plugins/redmine_watcher_groups">http://www.redmine.org/plugins/redmine_watcher_groups</a> - in difference from other solutions, with this plugin notifications are sent to current group members.</p>
</blockquote>
<p>Hi, is this plugin availabe (or will be available) for version 2.4.x ?</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=551662014-03-05T06:25:32ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/4244">Feature #4244</a>: Multiple email addresses for each user</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=592702014-10-21T06:02:22ZStephane Lapie
<ul></ul><p>The above plug-in has one pitfall, it does not allow for proper "watcher" search queries : suppose I want to build an issue listing query for which tickets I am watching, from /issues/, at this stage, using this plug-in only shows issues where I (as a User) am explicitely set as a watcher, but does not take in account Groups.</p>
I have made my own customized version of the watcher groups : <a class="external" href="https://github.com/darksoul42/redmine_watcher_groups">https://github.com/darksoul42/redmine_watcher_groups</a> which also :
<ul>
<li>works properly with Postgres, now (Removed the ` MySQL-ism from the SQL queries)</li>
<li>stores journal entries for watcher groups added/removed to ticket</li>
<li>has a Japanese locale</li>
<li>coordinates with the Redmine People plug-in from CRM to list group members</li>
</ul>
<p>However, given it merely relies on the assumption that a Group and a User are deep down the same object, and the Principal->{User,Group} class inheritance to make things works, but basically shoves something in the watcher table that was not endorsed by Redmine via a raw SQL query, this means that for every Redmine upgrade, I have to be especially careful that this design axiom remains true. This sort of feels like a feature that should be built inside of Redmine core, and not as a plug-in.</p>
<p>I currently have a request from my company to implement a watcher query that takes in account watcher groups (which is of course very easy to do since this already works for tickets assigned to a group) :<br /><pre><code class="diff syntaxhl"><span class="gd">--- app/models/query.rb.old 2014-10-21 12:21:55.601988870 +0900
</span><span class="gi">+++ app/models/query.rb 2014-10-21 12:22:22.994264149 +0900
</span><span class="p">@@ -546,7 +546,7 @@</span>
if v.delete("me")
if User.current.logged?
v.push(User.current.id.to_s)
<span class="gd">- v += User.current.group_ids.map(&:to_s) if field == 'assigned_to_id'
</span><span class="gi">+ v += User.current.group_ids.map(&:to_s) if field == 'assigned_to_id' or field == 'watcher_id'
</span> else
v.push("0")
end
</code></pre></p>
<p>Basically what this change does is, get the list of watchable issues from the watchers, when the watcher "user_id" is actually all the group_ids behind that user. This would not impact normal operation, as the Redmine current model does not allow addition via API of anything besides Users to the watchers table.</p>
Given that this code change is located within a loop used to create the SQL query for the search, it can not realistically be implemented with a plugin :
<ul>
<li>Method override would mean playing catch-up with core code just to add a "or" condition here</li>
<li>Chaining alias are only really efficient for pre or post processing, and not usable here</li>
</ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=594072014-10-26T11:26:57ZAkipii Oga
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=604482014-12-18T10:47:15ZAnonymous
<ul></ul><p>Stephane Lapie wrote:</p>
<blockquote>
<p>The above plug-in has one pitfall, it does not allow for proper "watcher" search queries : suppose I want to build an issue listing query for which tickets I am watching, from /issues/, at this stage, using this plug-in only shows issues where I (as a User) am explicitely set as a watcher, but does not take in account Groups.</p>
I have made my own customized version of the watcher groups : <a class="external" href="https://github.com/darksoul42/redmine_watcher_groups">https://github.com/darksoul42/redmine_watcher_groups</a> which also :
<ul>
<li>works properly with Postgres, now (Removed the ` MySQL-ism from the SQL queries)</li>
<li>stores journal entries for watcher groups added/removed to ticket</li>
<li>has a Japanese locale</li>
<li>coordinates with the Redmine People plug-in from CRM to list group members</li>
</ul>
<p>However, given it merely relies on the assumption that a Group and a User are deep down the same object, and the Principal->{User,Group} class inheritance to make things works, but basically shoves something in the watcher table that was not endorsed by Redmine via a raw SQL query, this means that for every Redmine upgrade, I have to be especially careful that this design axiom remains true. This sort of feels like a feature that should be built inside of Redmine core, and not as a plug-in.</p>
<p>I currently have a request from my company to implement a watcher query that takes in account watcher groups (which is of course very easy to do since this already works for tickets assigned to a group) :<br />[...]</p>
<p>Basically what this change does is, get the list of watchable issues from the watchers, when the watcher "user_id" is actually all the group_ids behind that user. This would not impact normal operation, as the Redmine current model does not allow addition via API of anything besides Users to the watchers table.</p>
Given that this code change is located within a loop used to create the SQL query for the search, it can not realistically be implemented with a plugin :
<ul>
<li>Method override would mean playing catch-up with core code just to add a "or" condition here</li>
<li>Chaining alias are only really efficient for pre or post processing, and not usable here</li>
</ul>
</blockquote>
<p>I just installed the plugin. Why can I only assign a user group when the issue is already reported?</p>
<p>It would be nice if I can assign a group when I report a new issue.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=636852015-05-13T09:32:56ZMartin G
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=638412015-05-22T15:23:28ZBenjamin Baumann
<ul></ul><p>If you are looking for a watcher group plugin working at issue update AND at issue creation you can take a look at Alexei Margasov fork of redmine_watcher_plugin : <a class="external" href="https://github.com/nauphone/redmine_watcher_groups">https://github.com/nauphone/redmine_watcher_groups</a></p>
<p>It's working in my redmine 2.6.1 install.</p>
<p>The group is not notified on the ticket creation though.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=659222015-09-10T14:29:06ZInese Ez
<ul></ul><p>Benjamin Baumann wrote:</p>
<blockquote>
<p>If you are looking for a watcher group plugin working at issue update AND at issue creation you can take a look at Alexei Margasov fork of redmine_watcher_plugin : <a class="external" href="https://github.com/nauphone/redmine_watcher_groups">https://github.com/nauphone/redmine_watcher_groups</a></p>
<p>It's working in my redmine 2.6.1 install.</p>
</blockquote>
<p>as well as on 2.3.4.stable.</p>
<blockquote>
<p>The group is not notified on the ticket creation though.</p>
</blockquote>
<p>And all groups are visible/selectable without taking into account their restriction to certain projects (on issue creation and when adding watchers).</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=660802015-09-17T15:07:01ZEnderson Maia
<ul></ul><p>Maybe someone could use the work done in chiliproject to back-port to Redmine.</p>
<p>See: <a class="external" href="https://www.chiliproject.org/issues/802">https://www.chiliproject.org/issues/802</a></p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=668952015-10-27T14:32:04ZPetr Mlčoch
<ul></ul><p>I make modifications to <code>redmine_watcher_groups</code> plugin to run it with Redmine 3.1.1.<br />See [[<a class="external" href="https://github.com/foton/redmine_watcher_groups.git">https://github.com/foton/redmine_watcher_groups.git</a>]]</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=763542017-01-28T09:27:51ZGo MAEDA
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/24943">Feature #24943</a>: Issue watchers to have groups in addition to users</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=793662017-06-21T09:48:17ZStephane Lapie
<ul></ul><p>Up, and a little update.<br />I updated upon Petr's plugin for Redmine 3.3.3-stable.</p>
<p>Here is my fork, but I also filled a pull request to his repository for good measure.<br /><a class="external" href="https://github.com/darksoul42/redmine_watcher_groups">https://github.com/darksoul42/redmine_watcher_groups</a></p>
<p>It seems there is one aggravating edge case, as the <code>acts_as_watchable</code> code uses and expects a <code>ActiveRecord_Associations_CollectionProxy</code> (calls to the <code>reset()</code> method), and the current code degraded it as an array, I tried a quick and dirty hack.</p>
<p>Return the array, but with a method that takes in the initial object within its context, and calls the original <code>reset()</code> method.<br />Hopefully this does whatever cleanup is expected, but still functions properly.</p>
<p>I am more and more convinced that such a deep change should be handled internally by Redmine, instead of going through an arms race with plugins...</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=797652017-07-05T12:33:49ZAndreas Deininger
<ul></ul><blockquote>
<p>Stephane Lapie wrote:</p>
<p>I updated upon Petr's plugin for Redmine 3.3.3-stable.</p>
</blockquote>
<p>Stephane, thanks for your efforts.</p>
<blockquote>
<p>Here is my fork, but I also filled a pull request to his repository for good measure.<br /><a class="external" href="https://github.com/darksoul42/redmine_watcher_groups">https://github.com/darksoul42/redmine_watcher_groups</a></p>
</blockquote>
<p>I installed your fork on a Redmine 3.4.0 instance, and it's causing problems there. Adding a watcher group work likes expected. Also, I can add an user as watcher (core Redmine functionality). If I try to delete the user I just added, Redmine server process exits silently. Maybe you can have a look into this?</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=802692017-07-25T11:06:40ZStephane Lapie
<ul></ul><p>Andreas,</p>
<p>I just had a look into that, and found that the <code>ActiveRecord_Associations_CollectionProxy</code> object does remain as such (and not degraded into an <code>Array</code>) when there are no watcher groups. Therefore in that case, I should not be defining the <code>reset()</code> method, which would trigger an endless recursion loop and a stack overflow. I suppose this is what you have seen, but could you confirm?</p>
<p>The fix is committed to my github.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=802722017-07-25T13:33:35ZCacilda de Miranda Lira
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=803162017-07-27T07:39:00ZLászló Bokodi
<ul></ul><p>Stephane,</p>
<p>Thanks for this great plugin. I installed on fresh 3.4.2 instance, but autocomplete function not worked for me.<br />I changed this line in <strong>watcher_groups_controller.rb</strong> from:</p>
<pre><code class="ruby syntaxhl"><span class="vi">@groups</span> <span class="o">=</span> <span class="no">Group</span><span class="p">.</span><span class="nf">active</span><span class="p">.</span><span class="nf">like</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:q</span><span class="p">]).</span><span class="nf">find</span><span class="p">(</span><span class="ss">:all</span><span class="p">,</span> <span class="ss">:limit</span> <span class="o">=></span> <span class="mi">100</span><span class="p">)</span>
</code></pre>
<p>to:<br /><pre><code class="ruby syntaxhl"><span class="vi">@groups</span> <span class="o">=</span> <span class="no">Group</span><span class="p">.</span><span class="nf">sorted</span><span class="p">.</span><span class="nf">active</span><span class="p">.</span><span class="nf">like</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:q</span><span class="p">]).</span><span class="nf">limit</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span>
</code></pre></p>
<p>and autocomplete function started to work.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=803182017-07-27T08:49:56ZStephane Lapie
<ul></ul><p>Ah, I see, this must have been an older API call I had missed.</p>
<p>I just integrated it.</p>
<p>Thanks!</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=806112017-08-14T10:09:28ZAndreas Deininger
<ul></ul><p>Stephane Lapie wrote:</p>
<blockquote>
<p>The fix is committed to my github.</p>
</blockquote>
<p>Stephane, thanks for your efforts.</p>
<blockquote>
<p>I suppose this is what you have seen, but could you confirm?</p>
</blockquote>
<p>I just installed the master of your github project on an fresh Redmine 3.4.2 instance, and yes, I can confirm that the plugin is working now. That's great!</p>
<p>As far as I can see, there's still a small glitch here. Here is the way to reproduce:</p>
<ol>
<li>Open an existing ticket with no watchers defined.</li>
<li>In the right bar, click on "Add" (right beneath the heading "Watchers group") to add a watcher group to an existing project. All persons of the watcher group are instantly shown as watchers. That's perfectly fine.</li>
<li>In the right bar, click on "Add" (right beneath the heading "Watchers") to add a single person as watcher. The person is added as watcher, but does not show up instantly in the watchers list. If I reload the page, the person appears in the list of persons watching the issue.</li>
</ol>
<p>The good thing is that the person is actually added, so it's merely a display issue. Nevertheless, this behaviour might confuse users.</p>
<p>Note: The same applies if I delete an existing watcher (single person) by clicking on the trash bin symbol. The person is only removed from the watchers list after reloading the page.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=846462018-04-25T13:18:35Zcleber souza
<ul><li><strong>File</strong> <a href="/attachments/20548">Issue page.JPG</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/20548/Issue%20page.JPG">Issue page.JPG</a> added</li></ul><p>Stephane Lapie wrote:</p>
<blockquote>
<p>Up, and a little update.<br />I updated upon Petr's plugin for Redmine 3.3.3-stable.</p>
<p>Here is my fork, but I also filled a pull request to his repository for good measure.<br /><a class="external" href="https://github.com/darksoul42/redmine_watcher_groups">https://github.com/darksoul42/redmine_watcher_groups</a></p>
<p>It seems there is one aggravating edge case, as the <code>acts_as_watchable</code> code uses and expects a <code>ActiveRecord_Associations_CollectionProxy</code> (calls to the <code>reset()</code> method), and the current code degraded it as an array, I tried a quick and dirty hack.</p>
<p>Return the array, but with a method that takes in the initial object within its context, and calls the original <code>reset()</code> method.<br />Hopefully this does whatever cleanup is expected, but still functions properly.</p>
<p>I am more and more convinced that such a deep change should be handled internally by Redmine, instead of going through an arms race with plugins...</p>
</blockquote>
<p>Thanks Stephane for this version of the plugin, but in the version of Redmine 3.4.4 stable. The Plugin is installed normally, but when it will access the task screen the error below is displayed.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=846552018-04-25T19:41:46Zcleber souza
<ul></ul><p>cleber souza wrote:</p>
<blockquote>
<p>Stephane Lapie wrote:</p>
<blockquote>
<p>Up, and a little update.<br />I updated upon Petr's plugin for Redmine 3.3.3-stable.</p>
<p>Here is my fork, but I also filled a pull request to his repository for good measure.<br /><a class="external" href="https://github.com/darksoul42/redmine_watcher_groups">https://github.com/darksoul42/redmine_watcher_groups</a></p>
<p>It seems there is one aggravating edge case, as the <code>acts_as_watchable</code> code uses and expects a <code>ActiveRecord_Associations_CollectionProxy</code> (calls to the <code>reset()</code> method), and the current code degraded it as an array, I tried a quick and dirty hack.</p>
<p>Return the array, but with a method that takes in the initial object within its context, and calls the original <code>reset()</code> method.<br />Hopefully this does whatever cleanup is expected, but still functions properly.</p>
<p>I am more and more convinced that such a deep change should be handled internally by Redmine, instead of going through an arms race with plugins...</p>
</blockquote>
<p>Thanks Stephane for this version of the plugin, but in the version of Redmine 3.4.4 stable. The Plugin is installed normally, but when it will access the task screen the error below is displayed.</p>
</blockquote>
<p>Resolved compatibility version: <a class="external" href="https://github.com/piccio/redmine_watchers_groups">https://github.com/piccio/redmine_watchers_groups</a></p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=852692018-05-29T09:00:24ZVlad Belkov
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=870152018-09-06T05:37:36ZGo MAEDA
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/15164">Feature #15164</a>: Make it possible to add group as a watcher</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=870172018-09-06T05:38:04ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/29501">Feature #29501</a>: Allow addition of watcher group via bulk edit context menu</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=884672018-11-21T10:37:33ZSunding Wei
<ul></ul><blockquote>
<p>cleber souza wrote:<br />...<br />Resolved compatibility version: <a class="external" href="https://github.com/piccio/redmine_watchers_groups">https://github.com/piccio/redmine_watchers_groups</a></p>
</blockquote>
<p>Hi Cleber Souza</p>
<p>I installed the plugin you provided for Redmine v3.4.4.stable, it works for creating issues with groups watchers, but when I open the issue I just created, the ruby process takes CPU 100%...I have to uninstall it, do you know what should be the issue?</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=884762018-11-22T05:50:44ZSunding Wei
<ul></ul><p>I fixed the CPU 100% issue of Cleber Souza codes</p>
<p>Redmine 3.4.4.stable<br />Original: <a class="external" href="https://github.com/piccio/redmine_watchers_groups">https://github.com/piccio/redmine_watchers_groups</a></p>
<p>Fixes<br /><pre><code class="diff syntaxhl"><span class="gh">diff --git a/lib/redmine_watchers_groups/group_patch.rb b/lib/redmine_watchers_groups/group_patch.rb
index 567f2a0..a3a7bb8 100644
</span><span class="gd">--- a/lib/redmine_watchers_groups/group_patch.rb
</span><span class="gi">+++ b/lib/redmine_watchers_groups/group_patch.rb
</span><span class="p">@@ -22,7 +22,17 @@</span> module RedmineWatchersGroups
unless watcher_ids.empty?
# simple combinations of watchers
<span class="gd">- simple_watchers_combinations = watcher_ids.repeated_combination(watcher_ids.length).to_a.map(&:uniq).uniq
</span><span class="gi">+ # FIXME: CPU 100%, producing too many combinations
+ # simple_watchers_combinations = watcher_ids.repeated_combination(watcher_ids.length).to_a.map(&:uniq).uniq
+ users = User.where(id: watcher_ids)
+ dict = {}
+ users.each do |user|
+ user.group_ids.each do |gid|
+ ids = dict[gid].to_a.push(user.id)
+ dict[gid] = ids.uniq
+ end
+ end
+ simple_watchers_combinations = dict.values
</span>
simple_watchers_combinations.each do |simple_watchers_combination|
# the first query find all groups that contains all the current watchers as members through
<span class="p">@@ -48,4 +58,5 @@</span> module RedmineWatchersGroups
end
end
<span class="gd">-end
</span><span class="err">\</span> No newline at end of file
<span class="gi">+end
+
</span></code></pre></p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=891142018-12-21T08:35:25ZJonas De Meulenaere
<ul></ul><p>+1 to have it implemented as a standard feature</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=910862019-04-03T07:56:43ZThomas Guiot
<ul></ul><p>Sunding Wei wrote:</p>
<blockquote>
<p>I fixed the CPU 100% issue of Cleber Souza codes</p>
<p>Redmine 3.4.4.stable<br />Original: <a class="external" href="https://github.com/piccio/redmine_watchers_groups">https://github.com/piccio/redmine_watchers_groups</a></p>
<p>Fixes<br />[...]</p>
</blockquote>
<p>This plugin crashed the tickets where I used a group as observer. see <a class="external" href="https://github.com/piccio/redmine_watchers_groups/issues/4">https://github.com/piccio/redmine_watchers_groups/issues/4</a></p>
<p>and +1 to have it as a standard feature</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=912192019-04-15T06:28:08ZGerhard Ferdan
<ul></ul><p>+1 to have it implemented as a standard feature.<br />We used the <a class="external" href="https://www.redmine.org/plugins/rmp_group_watchers">https://www.redmine.org/plugins/rmp_group_watchers</a> plugin until now but since updating to V4.x the plugin isn't longer useable</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=928922019-07-30T06:50:04ZTaine Woo
<ul></ul><p>+1</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=960002020-01-31T02:23:00ZYuichi HARADA
<ul><li><strong>File</strong> <a href="/attachments/24735">4511-add-group-to-watcher.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24735/4511-add-group-to-watcher.patch">4511-add-group-to-watcher.patch</a> added</li></ul><p>Fixed functionality to allow adding groups to the watcher of issues.<br />I attached a patch.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=960032020-01-31T07:05:22ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/24736">4511-add-group-to-watcher-v2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24736/4511-add-group-to-watcher-v2.patch">4511-add-group-to-watcher-v2.patch</a> added</li><li><strong>File</strong> <a href="/attachments/24738">Screenshot_add-watcher.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24738/Screenshot_add-watcher.png">Screenshot_add-watcher.png</a> added</li><li><strong>File</strong> <a href="/attachments/24739">Screenshot_watchers-list.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24739/Screenshot_watchers-list.png">Screenshot_watchers-list.png</a> added</li><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul><p>Yuichi HARADA wrote:</p>
<blockquote>
<p>Fixed functionality to allow adding groups to the watcher of issues.<br />I attached a patch.</p>
</blockquote>
<p>Thank you for posting the patch for this long-awaited feature. I tried out the patch and it works fine.</p>
<p><img src="https://www.redmine.org/attachments/download/24738/Screenshot_add-watcher.png" style="width: 433px;border: 1px solid grey;" alt="" /></p>
<p><img src="https://www.redmine.org/attachments/download/24739/Screenshot_watchers-list.png" style="width: 295px;border: 1px solid grey;" alt="" /></p>
<p>I slightly updated the patch to fix RuboCop offenses.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=960462020-02-03T08:41:01ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>4.2.0</i></li></ul><p>Setting the target version to 4.2.0.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=961212020-02-06T05:24:23ZYuichi HARADA
<ul><li><strong>File</strong> <a href="/attachments/24770">4511-add-group-to-watcher-v3.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24770/4511-add-group-to-watcher-v3.patch">4511-add-group-to-watcher-v3.patch</a> added</li></ul><p>Sorry, When entering a new issue, the groups of the project members must appear in the Watchers field.<br />Fixed with the following patch.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index c741a9326..e0de27464 100644
</span><span class="gd">--- a/app/controllers/watchers_controller.rb
</span><span class="gi">+++ b/app/controllers/watchers_controller.rb
</span><span class="p">@@ -122,14 +122,16 @@</span> class WatchersController < ApplicationController
end
def users_for_new_watcher
<span class="gd">- scope = nil
</span><span class="gi">+ scope, scope_groups = nil
</span> if params[:q].blank? && @project.present?
scope = @project.users
<span class="gi">+ scope_groups = @project.principals.merge(Group.givable)
</span> else
scope = User.all.limit(100)
<span class="gi">+ scope_groups = Group.givable.limit(100)
</span> end
users = scope.active.visible.sorted.like(params[:q]).to_a
<span class="gd">- users += Group.givable.active.visible.sorted.like(params[:q]).to_a
</span><span class="gi">+ users += scope_groups.active.visible.sorted.like(params[:q]).to_a
</span> if @watchables && @watchables.size == 1
users -= @watchables.first.watcher_users
end
<span class="gh">diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 34411470f..0f327b77e 100644
</span><span class="gd">--- a/app/helpers/issues_helper.rb
</span><span class="gi">+++ b/app/helpers/issues_helper.rb
</span><span class="p">@@ -365,8 +365,11 @@</span> module IssuesHelper
# on the new issue form
def users_for_new_issue_watchers(issue)
users = issue.watcher_users.select{|u| u.status == User::STATUS_ACTIVE}
<span class="gd">- if issue.project.users.count + Group.givable.count <= 20
- users = (users + issue.project.users.sort + Group.givable.sort).uniq
</span><span class="gi">+ project = issue.project
+ scope_users = project.users
+ scope_groups = project.principals.merge(Group.givable)
+ if scope_users.count + scope_groups.count <= 20
+ users = (users + scope_users.sort + scope_groups.sort).uniq
</span> end
users
end
<span class="gh">diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index e8dc9ee7b..e37151d8f 100644
</span><span class="gd">--- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
</span><span class="gi">+++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
</span><span class="p">@@ -31,7 +31,7 @@</span> module Redmine
# Returns an array of users that are proposed as watchers
def addable_watcher_users
<span class="gd">- users = (self.project.users.sort + Group.givable.sort) - self.watcher_users
</span><span class="gi">+ users = (self.project.users.sort + self.project.principals.merge(Group.givable).sort) - self.watcher_users
</span> if respond_to?(:visible?)
users.reject! {|user| user.is_a?(User) && !visible?(user)}
end
</code></pre> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=961262020-02-06T08:20:32ZGo MAEDA
<ul><li><strong>Subject</strong> changed from <i>Allowing to add user groups as watchers for issues</i> to <i>Allow adding user groups as watchers for issues</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed the patch. Thank you for writing the patch for this long-awaited feature.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=963782020-02-21T02:53:02ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/33036">Patch #33036</a>: Add missing fixture to IssuesControllerTest</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=965912020-03-05T12:40:14ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/33100">Patch #33100</a>: Fix a test - Issue watchers are not always sorted by id</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974082020-04-20T22:08:40ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0003-Use-principals-in-acts_as_watchable.patch</i> added</li><li><strong>File</strong> <i>0002-Use-Principal-to-get-users-and-groups-for-watchers-i.patch</i> added</li><li><strong>File</strong> <i>0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</i> added</li><li><strong>File</strong> <i>0004-Use-scope-assignable_watchers.patch</i> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>I'm reopening this in order to fix some possible performance issues generated by these changes or some unnecessary queries:</p>
<p>1. Removing <code>preload(:email_address)</code> from <code>watchers_list</code> (app/helpers/watchers_helper.rb) generates N+1. For each watcher, it will be triggered a query to take the email address. Below an example of an issue with 5 watchers:</p>
<pre>
D, [2020-04-20T20:26:37.979524 #14] DEBUG -- : User Load (0.9ms) SELECT `users`.* FROM `users` INNER JOIN `watchers` ON `users`.`id` = `watchers`.`user_id` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `watchers`.`watchable_id` = 2 AND `watchers`.`watchable_type` = 'Issue'
D, [2020-04-20T20:26:37.982628 #14] DEBUG -- : EmailAddress Load (0.6ms) SELECT `email_addresses`.* FROM `email_addresses` WHERE `email_addresses`.`user_id` = 1 AND `email_addresses`.`is_default` = TRUE LIMIT 1
D, [2020-04-20T20:26:37.988894 #14] DEBUG -- : CACHE EmailAddress Load (0.1ms) SELECT `email_addresses`.* FROM `email_addresses` WHERE `email_addresses`.`user_id` = 3 AND `email_addresses`.`is_default` = TRUE LIMIT 1
D, [2020-04-20T20:26:37.991870 #14] DEBUG -- : EmailAddress Load (0.6ms) SELECT `email_addresses`.* FROM `email_addresses` WHERE `email_addresses`.`user_id` = 4 AND `email_addresses`.`is_default` = TRUE LIMIT 1
D, [2020-04-20T20:26:37.994146 #14] DEBUG -- : CACHE EmailAddress Load (0.0ms) SELECT `email_addresses`.* FROM `email_addresses` WHERE `email_addresses`.`user_id` = 2 AND `email_addresses`.`is_default` = TRUE LIMIT 1
D, [2020-04-20T20:26:37.996693 #14] DEBUG -- : EmailAddress Load (0.6ms) SELECT `email_addresses`.* FROM `email_addresses` WHERE `email_addresses`.`user_id` = 8 AND `email_addresses`.`is_default` = TRUE LIMIT 1
I, [2020-04-20T20:26:38.000373 #14] INFO -- : Rendered watchers/_watchers.html.erb (92.5ms)
I, [2020-04-20T20:26:38.006492 #14] INFO -- : Rendered issues/show.html.erb within layouts/base (1418.9ms)
D, [2020-04-20T20:26:38.010703 #14] DEBUG -- : Setting Load (0.6ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'app_title' ORDER BY `settings`.`id` DESC LIMIT 1
D, [2020-04-20T20:26:38.028354 #14] DEBUG -- : CACHE EmailAddress Load (0.0ms) SELECT `email_addresses`.* FROM `email_addresses` WHERE `email_addresses`.`user_id` = 1 AND `email_addresses`.`is_default` = TRUE LIMIT 1
</pre>
<p>I think we should find a better way to retrieve the watchers in order to avoid all those queries.</p>
<p>2. In <code>app/helpers/issues_helper.rb</code> we can avoid querying the database twice to get the users and then the groups by using the patch <em>0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</em>. Also, the patch limits the results returned from the database to 20 because that is the maximum number of watchers displayed in the new issue form.</p>
<p>3. Same as 2 but in <code>watchers_controller</code> and <code>acts_as_watchable</code> with patches <em>0002-Use-Principal-to-get-users-and-groups-for-watchers-i.patch</em> and <em>0003-Use-principals-in-acts_as_watchable.patch</em></p>
<p>Example:<br /><pre>
D, [2020-04-20T21:05:29.355800 #14] DEBUG -- : User Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`status` = 1 AND `users`.`id` IN (3, 2)
D, [2020-04-20T21:05:29.358191 #14] DEBUG -- : Group Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('Group', 'GroupBuiltin', 'GroupAnonymous', 'GroupNonMember') AND `users`.`type` = 'Group' AND `users`.`status` = 1 AND `users`.`id` IN (3, 2)
</pre></p>
<p>After:<br /><pre>
D, [2020-04-20T21:09:11.148277 #14] DEBUG -- : Principal Load (0.9ms) SELECT `users`.* FROM `users` WHERE `users`.`status` = 1 AND `users`.`id` IN (3, 2) AND `users`.`type` IN ('User', 'Group')
</pre></p>
<p>4. This patch adds a new scope named <code>assignable_watchers</code> to <code>Principal</code> in order to avoid duplicated logic across multiple files. Any feedback is welcome.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974092020-04-20T22:16:12ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0004-Use-scope-assignable_watchers.patch</i></del>)</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974112020-04-20T22:32:06ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0004-Use-scope-assignable_watchers.patch</i> added</li></ul><p>Fixed a minor issue.</p>
<p>Tests <a href="https://gitlab.com/redmine-org/redmine/pipelines/138061753" class="external">pass</a>.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974782020-04-25T03:15:50ZGo MAEDA
<ul></ul><p>Marius, thank you for improving the code but I noticed that <a class="attachment" href="https://www.redmine.org/attachments/25288">0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</a> change the behavior.</p>
<p>Redmine 2.5 or later does not show watchers checkboxes on the new issue page when more than 20 members belong to the project (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Watchers list too big in new issue form (Closed)" href="https://www.redmine.org/issues/8562">#8562</a>). However, after applying the patch, first 20 members/groups are displayed even when the number of members exceeds 20.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974822020-04-25T07:24:34ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0004-Use-scope-assignable_watchers.patch</i></del>)</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974832020-04-25T07:24:37ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0002-Use-Principal-to-get-users-and-groups-for-watchers-i.patch</i></del>)</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974842020-04-25T07:24:40ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</i></del>)</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974852020-04-25T07:24:42ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0003-Use-principals-in-acts_as_watchable.patch</i></del>)</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974872020-04-25T07:31:52ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/25286">0004-Use-scope-assignable_watchers.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25286/0004-Use-scope-assignable_watchers.patch">0004-Use-scope-assignable_watchers.patch</a> added</li><li><strong>File</strong> <a href="/attachments/25285">0003-Use-principals-in-acts_as_watchable.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25285/0003-Use-principals-in-acts_as_watchable.patch">0003-Use-principals-in-acts_as_watchable.patch</a> added</li><li><strong>File</strong> <a href="/attachments/25287">0002-Use-Principal-to-get-users-and-groups-for-watchers-i.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25287/0002-Use-Principal-to-get-users-and-groups-for-watchers-i.patch">0002-Use-Principal-to-get-users-and-groups-for-watchers-i.patch</a> added</li><li><strong>File</strong> <a href="/attachments/25288">0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25288/0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch">0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</a> added</li></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Marius, thank you for improving the code but I noticed that <a class="attachment" href="https://www.redmine.org/attachments/25288">0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch</a> change the behavior.</p>
<p>Redmine 2.5 or later does not show watchers checkboxes on the new issue page when more than 20 members belong to the project (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Watchers list too big in new issue form (Closed)" href="https://www.redmine.org/issues/8562">#8562</a>). However, after applying the patch, first 20 members/groups are displayed even when the number of members exceeds 20.</p>
</blockquote>
<p>You're right, thanks for pointing this out, I've updated the patch series to fix this.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974902020-04-25T08:03:02ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Committed the patches attached in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Allow adding user groups as watchers for issues (Closed)" href="https://www.redmine.org/issues/4511#note-73">#4511#note-73</a>. Thank you.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=974912020-04-25T08:05:41ZMarius BĂLTEANU
<ul></ul><p>Regarding first problem (N+1), we don’t do anything?</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=980992020-06-08T12:03:58ZTaner Tas
<ul></ul><p>I just need to add groups as watchers like regular user. I tried patches shared in this issue but none of them are applicable for 4.0 version.</p>
<pre>
if subject.present?
self.add_watcher(project.default_assigned_to) unless watched_by?(project.default_assigned_to)
end
</pre>
<p>Our project default assignees are groups. The custom workflow code above doesn't work because, Redmine 4.0 doesn't accept groups as known type for watchers.</p> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=990152020-09-01T00:58:28ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/33935">Defect #33935</a>: Locked users in a group receive notifications when the group is added as a watcher</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=1065772022-05-02T12:05:41ZHolger Just
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/37065">Patch #37065</a>: When someone is member of watcher group, 'watched_by' may be wrong and incomplete</i> added</li></ul> Redmine - Feature #4511: Allow adding user groups as watchers for issueshttps://www.redmine.org/issues/4511?journal_id=1085832022-11-23T10:48:32ZMiodrag Milic
<ul></ul><p>There seems to be a bug in this feature - groups added as watchers are shown as text, not as links (like in Overview panel or like when adding users in watchers or when setting a group as assignee). Consequently, you can't see members of the group on the ticket)</p>
<p>I created a ticket for this: <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Groups added to watchers are not shown as links (Closed)" href="https://www.redmine.org/issues/37958">#37958</a></p>