Skip to main content
Skip table of contents

Writing dynamic queries with dependencies for custom fields

A key feature of Elements Connect is the ability to write dynamic queries using query dependencies.
A query can depend on

  • the value of other Custom fields,

  • the current user editing the fields

  • the user input (what the user is typing in the select list)

Why use dynamic queries?

Dynamic queries allow users to configure multi-level cascading fields. 

In the following use case, we'll see how Elements Connect is useful and how it can simplify tickets creation and categorization using dependencies.

You are responsible for overseeing the embedded car software at the world's leading car company. When dealing with new features, you must ensure that they are developed for the right car model.
All the car you manufacture are stored in your internal asset management tool, and Elements Connect fetches data from it.

You need the following information to specify your needs:

  • Continent

    • Value: North America

  • Country, based on the selected continent

    • Value: United States of America

  • Car, based on the car types available in the selected country

    • Value: Tesla Model 3

  • Model, based on the car type

    • Value: Model 3 Performance

Each attribute here is a Connect custom field and dependencies on the parent field is made using the following syntax, directly in the query:

$issue.customfield_xxxxx where xxxxx is the ID of the Connect custom field

Please note that all queries with dependencies won't be executed if their parent field has no value. 

Go a bit further regarding this topic

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.