Skip to main content
Skip table of contents

Query guide

In order to display data in a connected Jira field, the first step in Elements Connect’s workflow consists in executing a query to a data source which will retrieve a result set from it.

connect-query.png

These queries can be static or dynamic, and depend on the type of data source.

Static queries

Static queries are simple requests made to an API endpoint or a database following their specific syntax.

For example, let’s say you want to retrieve a list of continents from your data source. A static query to a REST API could look like this:

API request

CODE
{BaseURL}/continents

And a static query to a database could look like this:

SQL query

SQL
SELECT continent
FROM continents

These queries are set up in the “Fetch data from data source” step of the connected custom field or connected item configuration.

Dynamic queries

Dependencies

A key feature of Elements Connect is the ability to write dynamic queries using dependencies. This means that the query that is used to retrieve data from external sources can dynamically change depending on several factors, such as:

  • the value of other custom fields (native Jira fields or Elements Connect fields)

  • the current user editing the fields

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

Purpose

One of the reasons to use dynamic queries is that they allow multi-level cascading fields. This means that you can have several select-list fields which value depends on the value of the previous one.

For example, you can have three select-list fields “Continent”, “Country”, and “Car”.

  • First, the user can select a continent (“North America”)

  • Then, they can select a country among a dynamic list based on this continent (“Canada”)

  • Finally, they can select a car among a dynamic list of cars available in Canada

Each select-list here is an Elements Connect connected field, and the dependencies on each parent field (“Continent” and “Country”) are made directly in the connected field query. The appropriate syntax for your query can be found in the examples below.

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

Examples

You will find many examples of how to create dependencies in the following pages.

Known limitations

For performance purposes, Elements Connect will only read the first 1,000 rows of a result set. To access the subsequent row, use the $userInput parameter.

JavaScript errors detected

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

If this problem persists, please contact our support.