Skip to end of banner
Go to start of banner

Example 4 - Dependent custom fields

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

In order to use dependent fields you must have Power Scripts for Jira app installed and enabled.

To use the screen values for a field in the data source, you have to add it as a dependent field. 


Example: Let's say we have two custom fields: one PCF-PRO - Single Autocomplete and one PCF-PRO - Multiple Autocomplete, the second one is populated depending on the value of the first one.

An easy example is following: the first custom field has five options, representing the five continents, and the second one contains the countries from some table ("countries"), depending on the value selected on the first one. 

You can see the corresponding data sources below.

The following data source represents the first custom field: 

return {"AFRICA", "ASIA", "EUROPE", "AMERICA", "OCEANIA"};


The following data source represents the second custom field: 

string x = argv["customfield_10101"];
string[] res = sql("myDB", "select country from countries where continent like '" + x + "'");
return res;


The following result will be in the issue view screen: 


A similar example can be found here.

For the moment, dependent fields can only be used by the two custom fields with autocomplete.

From Power Custom Fields PRO 4.0.0, you can now use the dependent fields on SQL data sources as well.

In order to get the value set on the screen for one custom field, you will have to refer it like this: "argv[customfield_id]"

  • No labels