Skip to main content
Skip table of contents

Dependencies between Connect custom fields

Based on the previous example, let's see how we can configure it using dependencies between 2 (or more) fields.

Remember, we need to configure 4 fields:

  • Continent (ID 10001)
    • Value fetched using REST API
  • Country (ID 10002), based on the selected continent, 
    • Value fetched using REST API
  • Car (ID 10003), based on the car types available in the selected country
    • Value stored in a database
  • Model (ID 10004), based on the car type
    • Value stored in a database

Configuration

Continent

This is the parent field, it doesn't contain any dependencies and is just going to fetch a list of every continent.
User should select one.

Continent query - REST API

CODE
{BaseURL}/continents

Country

Country depends on the value selected in the Continent custom field.

Country query - REST API

CODE
{BaseURL}/countries?continent='$issue.customfield_10001'

Car

Car depends on the selected country. Yes, depending on the country you're in, cars sold aren't the same!

Car query - database

SQL
SELECT car
FROM car_catalog
WHERE country ='$issue.customfield_10002' 

Model

Model depends on the car, where the engine or the embedded software can differ

Model query - database

SQL
SELECT model
FROM car_models
WHERE car ='$issue.customfield_10003' 

Warning for object type fields

For all object-type fields, you must specify in the dependency which attribute is to be used. 

Add ".id" after your custom field name to make sure dependency will be effective.

If customfield_10097 is type Object; then:

SELECT "Cell_phones"."salePrice", "Cell_phones"."name", "Cell_phones"."color"
FROM "Cell_phones"
WHERE "Cell_phones"."name" = '$issue.customfield_10097.id'


JavaScript errors detected

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

If this problem persists, please contact our support.