https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292016-04-07T10:09:31ZRedmineRedmine - Feature #22297: Group by custom field of type texthttps://www.redmine.org/issues/22297?journal_id=702012016-04-07T10:09:31ZToshi MARUYAMA
<ul><li><strong>Tracker</strong> changed from <i>Defect</i> to <i>Feature</i></li><li><strong>Subject</strong> changed from <i>Unable to group by custom field of type text</i> to <i>Group by custom field of type text</i></li></ul> Redmine - Feature #22297: Group by custom field of type texthttps://www.redmine.org/issues/22297?journal_id=831192018-01-15T08:23:37ZBruno Medeiros
<ul></ul><p>This seems to work already, at least in Planio hosted version. Maybe they contribute with a patch if that's the case.</p>
<p>What I see is that we cannot group by a field that is not for "all projects". Does it make sense?</p> Redmine - Feature #22297: Group by custom field of type texthttps://www.redmine.org/issues/22297?journal_id=832202018-01-18T21:56:17ZFelix Schäfer
<ul></ul><p>Bruno Medeiros wrote:</p>
<blockquote>
<p>This seems to work already, at least in Planio hosted version. Maybe they contribute with a patch if that's the case.</p>
</blockquote>
<p>This is something that we would contribute if we were to work on it, but I am not aware this is possible on Planio. Could you double-check that you can group an issue list by a custom field of type "text"?</p>
<blockquote>
<p>What I see is that we cannot group by a field that is not for "all projects". Does it make sense?</p>
</blockquote>
<p>I am able to group by a custom field that is defined on only one project in that project's issue list. Do you maybe mean that you can only use custom fields defined as "for all projects" to group by on the global issue list?</p> Redmine - Feature #22297: Group by custom field of type texthttps://www.redmine.org/issues/22297?journal_id=841992018-03-28T11:36:55ZHong Cheu Lim
<ul></ul><p>This indeed could be achieved by patching, see patch below.<br />This seem to work for me with minor limitation,i.e. string after n in the example below(255) char will be truncated<br /><pre>
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index fade7c2..ad9041c 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -387,6 +387,10 @@ module Redmine
value.to_s
end
end
+
+ def group_statement(custom_field)
+ "CAST(cf_#{custom_field.id}.value AS char(255))"
+ end
end
class TextFormat < Unbounded
</pre></p>
<pre>
Environment:
Redmine version 3.4.2.stable
Ruby version 2.4.2-p198 (2017-09-14) [x86_64-linux]
Rails version 4.2.8
Environment development
Database adapter Mysql2 (mariadb)
</pre> Redmine - Feature #22297: Group by custom field of type texthttps://www.redmine.org/issues/22297?journal_id=1083762022-10-27T07:27:50ZEugene B
<ul></ul><p>Anyone who can please post update for patch for 5.0.3 version.<br />patch above is now causing "thin" and "thin2" servers to stop</p>
<p>we used it alot.</p>