apsmir / custom_field_sql

redmine sql custom field
14 stars 9 forks source link

What is the use case for this? #1

Closed chrislockwood closed 3 years ago

chrislockwood commented 3 years ago

This plugin interests me, but I wonder about the specific use case, and how it improves over the standard custom fields. Any chance you can provide examples?

KrzysztofI commented 3 years ago

Here is example - concatenation subject and value of one custom field as caption in sql_field:

select subject ||coalesce(c1.value,'') from issues LEFT JOIN custom_values c1 ON c1.customized_id=issues.id AND c1.custom_field_id=24 where tracker_id = 6 and status_id = 2

for beginning: select subject from issues

or

select name from issue_statuses

chrislockwood commented 3 years ago

For sure I'll have a play with this, opens up some interesting possibilities. Nice work!

jankokert commented 3 years ago

SQL field With the simple SQL field, you can run a query that will result in a drop-down menu which is shown when that custom field is edited (e.g. project->configure). This is useful to confine the user input to select one value out of an already available dataset somewhere in the Redmine database (not an external database).

SQL seach field Unfortunately, I really don't understand how the SQL search field works. What I've got so far:

But here it ends... When selecting a value in one of the other custom fields (id=31), the search is not carried out. Also when I type something in the SQL search field it just acts as a normal string field. What is the purpose of that search field and what do I do wrong perhaps?