This page explains how to configure dynamic queries where the value of one Elements Connect connected field depends on the value of another. This is the pattern behind cascading select lists, parent-child field relationships, and multi-level filtering in Jira issues and JSM tickets.
Dependencies work with any type of data source - REST APIs and databases - including a Jira REST API pointing to your own Jira instance (a Jira-to-Jira data source).
The dependency configuration differs depending on whether you are using Connected custom fields or Connected items.
For more information about the differences between these types, check out this page: Connected fields configuration
👉 Dependency between Connected custom fields
👉 Dependency between Connected items
Dependency between Connected custom fields
The dependency configuration is done when setting up how your Connected custom field fetches data.
Dependency on a Single Select Connected custom field
In this example, we will create a dependency between a connected custom field “Country” and its Single Select parent field “Continent” (for which we need to know the unique identifier). You can find the exact identifiers of your connected custom fields in the ID column of the “Connected fields” page in Elements Connect.
For a REST API data source
-
Setting up the “Continent” field
This is the parent field, it doesn't contain any dependency.
API request:
{BaseURL}/continents
This request will simply fetch the list of every available continents from the data source and display it in the connected custom field.
In this example, the identifier of our Continent field is customfield_10001.
-
Setting up the “Country” field
The options in this field depend on the value selected in the Continent field.
The requests below will fetch the list of all available countries in the continent selected in the field with the identifier 10001.
API request:
The syntax changes based on the type of “Continent” field “Snapshot” or “Object” (as a reminder, the difference between those types is explained here: Connected custom field storage type choice).
For a Snapshot field:
The dependency will be built upon the template value of the parent field.
{BaseURL}/continents/$issue.customfield_10001/countries
For an Object field:
The dependency can be built upon the ID of the parent field:
{BaseURL}/continents/$issue.customfield_10001.id/countries
Or the dependency can be built upon the template value of the parent field:
{BaseURL}/continents/$issue.customfield_10001.value/countries
Although it’s recommended to use .id and .value especially when both are used at the same time, note that if no attribute is explicitly specified, the .id attribute is used by default.
So the following two URLs are equivalent:
{BaseURL}/continents/$issue.customfield_10001/countries
{BaseURL}/continents/$issue.customfield_10001.id/countries
For a Database data source
-
Setting up the “Continent” field
This is the parent field, it doesn't contain any dependency.
SQL query:
SELECT continent
FROM continents
This request will simply fetch the list of every available continents from the continents table in the data source and display it in the connected custom field.
-
Setting up the “Country” field
The options in this field depend on the value selected in the Continent field.
The request below will fetch the list of all available countries in the continent selected in the field with the identifier 10001.
SQL query:
The syntax changes based on the type of “Continent” field “Snapshot” or “Object”, used for “Continent” field (as a reminder, the difference between those types is explained here: Connected custom field storage type choice).
For a Snapshot field:
The dependency will be built upon the template value of the parent field.
SELECT country
FROM countries
WHERE continent = $issue.customfield_10001
For an Object field:
The dependency can be built upon the ID of the parent field:
SELECT country
FROM countries
WHERE continent = $issue.customfield_10001.id
Or the dependency can be built upon the template value of the parent field:
SELECT country
FROM countries
WHERE continent = $issue.customfield_10001.value
Although it’s recommended to use .id and .value especially when both are used at the same time, note that if no attribute is explicitly specified, the .id attribute is used by default.
So the following two queries are equivalent:
SELECT country
FROM countries
WHERE continent = $issue.customfield_10001
SELECT country
FROM countries
WHERE continent = $issue.customfield_10001.id
Dependency on a Multi Select Connected custom field
Elements Connect supports dependencies to Multi Select Connected custom fields.
Here are examples with REST API and Database data sources.
For a REST API data source
Here are some examples with REST API supporting multi value parameters, and how we can configure dynamic queries using dependency to a Multi Select field.
Jira Cloud REST API
This example creates a dependency between two connected custom fields both fetching data from the Jira REST API, a classic Jira-to-Jira data source pattern:
-
"Projects" is a Multi Select field listing all Jira projects
-
"Issue" is a field that lists all issues from the selected projects
The Issue field depends on the value of the Projects field (with ID customfield_10001).
-
“Projects” field API request
https://your-domain.atlassian.net/rest/api/latest/project
-
“Issue” field API request
The options in this field depend on the values selected in the “Projects” field.
The syntax changes based on the type of “Projects” field “Snapshot” or “Object” (as a reminder, the difference between those types is explained here: Connected custom field storage type choice).
For a Snapshot field:
The dependency will be built upon the template value of the parent field.
https://your-domain.atlassian.net/rest/api/latest/search/jql?jql=project IN ($issue.customfield_10001)
For an Object field:
The dependency can be built upon the IDs of the parent field:
https://your-domain.atlassian.net/rest/api/latest/search/jql?jql=project IN ($issue.customfield_10001.ids)
Or the dependency can be built upon the template values of the parent field:
https://your-domain.atlassian.net/rest/api/latest/search/jql?jql=project IN ($issue.customfield_10001.values)
For a Database data source
Let’s take the example of “Continent” and “Country” fields.
“Continent” is a Multi Select field and “Country” select list will contain all countries of all selected continents.
-
Setting up the “Continent” field
This is the parent field, it doesn't contain any dependency.
SQL query:
SELECT continent
FROM continents
This request will simply fetch the list of every available continents from the continents table in the data source and display it in the connected custom field.
-
Setting up the “Country” field
The options in this field depend on the value selected in the Continent field.
The request below will fetch the list of all available countries in the continent selected in the field with the identifier 10001.
SQL query:
The syntax changes based on the type of “Continent” field “Snapshot” or “Object”, used for “Continent” field (as a reminder, the difference between those types is explained here: Connected custom field storage type choice).
For a Snapshot field:
The dependency will be built upon the template value of the parent field.
SELECT country
FROM countries
WHERE continent IN ($issue.customfield_10001)
For an Object field:
The dependency can be built upon the IDs of the field:
SELECT country
FROM countries
WHERE continent IN ($issue.customfield_10001.ids)
Or the dependency can be built upon the template values of the parent field:
SELECT country
FROM countries
WHERE continent IN ($issue.customfield_10001.values)
Information on the format of parent selected values
The format of parent selected values is a list of String separated by a comma.
Eg: If “FIN” and “ITSM” are the selected keys in “Projects” field with Object type,
${issue.customfield_10001.ids}
will return FIN,ITSM
And the evaluated query will be:
https://your-domain.atlassian.net/rest/api/latest/search/jql?jql=project IN (FIN,ITSM)
for our REST API example, and
SELECT country
FROM countries
WHERE continent IN (Europe, Asia)
for our Database example if “Europe” and “Asia” are selected in “Continent” field.
If the format “ID1,ID2” is not compatible with your data source calls format, you can reformat it thanks to FreeMarker.
Eg:
-
${(issue.customfield_10001.ids?split(","))[0]}
will return FIN
-
<#assign ids = issue.customfield_10001.ids> <#assign formatted = ids?split(",")?map(x -> "'" + x?trim + "'")?join(",")> ${formatted}
will return ‘FIN’,'ITSM'
Dependency modal
When clicking on a custom parent field in your ticket will open a modal.
This modal allows you to:
-
Update children fields when changing parent field value
-
Validate the changes by clicking on Submit or prevent changes by clicking on Cancel
-
Refresh the ticket page to see the updated values
Corner cases and known limitations for Connected custom field dependencies
Dependency on a field managed by a different app
If you used Elements Connect before version 7.0.0, you may now have two kinds of connected custom fields in your instance:
-
Post-7.0.0 fields - connected custom fields created after upgrading to Elements Connect 7.0.0
-
Pre-7.0.0 fields - connected custom fields created before the upgrade (marked as "helper's legacy" in their configuration banner)
Although there are no actual differences between how the fields are configured or behaving in your Jira issues, there is one thing you can’t do: Create dependencies between one another.
If you try to create a dependency between custom field A and custom field B (or the other way around)
-
You will get a warning message after saving your field configuration
-
Your field will be listed in Error with following error message:
Dependency on a field managed by a different app.
Missing or empty value
If a value referenced in a connected field is either:
-
not valid - the connected field is not on the form or it does not exist
-
empty - the user has not selected any value
then the variable will be replaced by an empty string.
For example, if the Continent connected field is not on the form or empty, the query will be interpreted as:
SELECT country
FROM countries
WHERE continent = ''
Dependency between Connected items
The dependency configuration is done when setting up how your Connected item fetches data.
In this example, we will create a dependency between a connected item “Country” and its parent Single Select field “Continent” (for which we need to know the unique identifier). You can find the exact identifiers of your connected fields in the ID column of the “Connected fields” page in Elements Connect.
Elements Connect only supports dependencies to connected items of type "Single Select", not “Multi Select” ones.
If you configure a Connected item with a dependency to a "Multi Select" connected item, the following error will display "Dependencies to Select list (multiple choices) are not yet supported. Remove dependency.".
For a REST API data source
-
Setting up the “Continent” field
This is the parent field, it doesn't contain any dependency.
API request:
{BaseURL}/continents
This request will simply fetch the list of every available continents from the data source and display it in the connected item.
In this example, the identifier of our Continent field is connected_item_10001.
-
Setting up the “Country” field
The options in this field depend on the value selected in the Continent field.
The requests below will fetch the list of all available countries in the continent selected in the field with the identifier 10001.
API request:
{BaseURL}/continents/$issue.connected_item_10001/countries
For a database data source
-
Setting up the “Continent” field
This is the parent field, it doesn't contain any dependency.
SQL query:
SELECT continent
FROM continents
This request will simply fetch the list of every available continents from the continents table in the data source and display it in the connected item.
-
Setting up the “Country” field
The options in this field depend on the value selected in the Continent field.
The request below will fetch the list of all available countries in the continent selected in the field with the identifier 10001.
SQL query:
SELECT country
FROM countries
WHERE continent = $issue.connected_item_10001
Corner cases and known limitations for Connected items dependencies
Missing or empty value
If a value referenced in a connected field is either:
-
not valid - the connected field is not on the form or it does not exist
-
empty - the user has not selected any value
then the variable will be replaced by an empty string.
For example, if the Continent connected field is not on the form or empty, the query will be interpreted as:
SELECT country
FROM countries
WHERE continent = ''
HTML in Connected item templates
When a connected item is referenced in another connected item query, Elements Connect replaces the reference by the value selected. If HTML is used in the template, the HTML code will be injected in the query.
For example, if the template of the Continent item is:
<strong>{Continent}</strong>
Then, the query of the Country connected item will be interpreted as:
SELECT country
FROM countries
WHERE continent = '<strong>North America</strong>'
Circular dependency
Elements Connect does not allow circular dependencies:
-
A Connected item cannot reference itself
-
It is not possible to have a loop in the dependency chain (i.e.: A → B → C → A is not authorized)
If a circular dependency is detected in a query, Elements Connect does not execute the query and an error message is displayed to the user editing the item.
Frequently asked questions
How do I create a cascading dropdown in Jira with Elements Connect?
Create two connected custom fields where the child field's query references the parent field's ID using $issue.customfield_XXXXX (or .id / .value / .ids / .values for Object and Multi Select fields). See the Continent → Country examples on this page.
What's the syntax difference between Snapshot and Object parent fields in dependencies?
For Snapshot parent fields: $issue.customfield_XXXXX uses the display value directly. For Object parent fields: $issue.customfield_XXXXX.id uses the stored ID (recommended), .value uses the template value. If no attribute is specified, .id is used by default.
Can Elements Connect handle dependencies to Multi Select parent fields?
Yes, for connected custom fields. Use .ids or .values (with the s) to get all selected values as a comma-separated list. Connected items do not support dependencies to Multi Select fields.
Can I create a cascading dependency using data from another Jira project?
Yes. Use a Jira REST API data source pointing to your Jira instance. The Projects → Issue example on this page shows this pattern, using /rest/api/latest/search/jql?jql=project IN (...) to fetch issues from the selected Jira projects.
What happens if the parent field is empty when the child query runs?
The variable is replaced by an empty string, so the query executes with an empty condition (e.g., WHERE continent = ''). The child field will typically return no results in this case.
Are circular dependencies allowed?
No. Elements Connect does not allow a connected item to reference itself, nor loops in the dependency chain (A → B → C → A). If detected, the query is not executed and an error is shown.