Code Monkey home page Code Monkey logo

Comments (3)

KrzysztofI avatar KrzysztofI commented on July 4, 2024 1

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

from custom_field_sql.

chrislockwood avatar chrislockwood commented on July 4, 2024

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

from custom_field_sql.

jankokert avatar jankokert commented on July 4, 2024

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:

  • In your query, you can insert one or me question marks (?) as placeholders for parameters
  • In the parameter section, every line defines one parameter
  • The line always starts with p0=, p1=, pN=...)
  • In every line, a javascript command is assigned to the parameter
  • We can use $(...) to get a DOM object by HTML id thanks to JQuery (short for: document.getElementById(...) )
  • By the DOM id we can get access to the content of other custom fields in the editing dialog, e.g. $('#issue_custom_field_values_31').val()
  • The DOM id can be retrieved in Firefox by right-clicking on a custom field and then choose to inspect / untersuchen

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?

from custom_field_sql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.