Versions Compared

Key

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

It is possible to search for specific values within a database field using JQL.

JQL Search Example

Given a field like the one configured above, if we wanted to find all the issues that have Nissan cars, we can do that using the JQL function seen below:

Code Block
issue.property["dbcf"].customfield_11100_make ~ Nissan

Breaking it Down

To see how this function works, lets break it apart:

  1. Prefix - This part of the function is static. This syntax should never change:

    Code Block
    issue.property["dbcf"]

  2. Field and label - The next part of the function is the id of the custom field that is getting searched (Ids will vary across instances. To look up the id of a custom field use the Custom Field Usage tool). Names and aliases do not work in place of the custom field id. After the underscore is the label, this corresponds to the row in the database field.

    Code Block
    customfield_11100_make

  3. Operator and value - It is important to ensure that you are using the proper operator type.

    Code Block
    ~ Nissan
    1. String - When searching strings it is recommended to use “~” and “!~” (contains and does not contain) instead of “=” and “!=” to get the best results.

    2. Numbers and Dates - When searching the normal numerical operators will work, such as “=, !=, <, >

More Examples

  1. Search for cares made after 2010:

    Code Block
    issue.property["dbcf"].customfield_11100_year > 2010

  2. Searching for a car by year and make:

    Code Block
    issue.property["dbcf"].customfield_11100_year = 2010 AND issue.property["dbcf"].customfield_11100_make ~ Mazda

  3. Search for issues missing a value for model:

    Code Block
    issue.property["dbcf"].customfield_11100_model is Empty

  4. Sear for issues with cars made in multiple years:

    Code Block
    issue.property["dbcf"].customfield_11100_year in (2010, 2011)

See More

Child pages (Children Display)
pageAdvanced Database Row Field (Next Gen)