Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note that the value of the custom field must first be saved on the issue if you use the last 5 types of fields.

Note

Dynamic query using numeric values for dependents

Normally in the WHERE clause we can have only columns of text type in combination with dynamic custom fields. If in the WHERE clause a numeric column (or some other type different from text) is used, the query does not work.

For instance if the column id is numeric in the table testTable, the following query:

Code Block
SELECT id, col2, col3, col4 FROM testTable WHERE id = {customfield_10300}

does not work, because the value of the customfield_10300 is a string.

The solution is to use functions available for the database chosen, to transform from string to the type of the column in the SQL query.

For instance, for PostgreSQL: SELECT id, col2, col3, col4 FROM testTable WHERE id = cast({customfield_10300} as numeric);

...