Skip to end of banner
Go to start of banner

Dynamic Query

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 22 Next »

How to use dynamic query on a database custom field in an issue

The following steps will guide you on how to use a dynamic query to retrieve values for a database custom field, based on the values of other custom fields :

  • Check in the administration page that you have a dynamic sql configured

 

The database custom field Product Name depends on the custom fields Published(customfield_11900) and Not published(customfield_11901).

  • Go to the issue and try to edit it. For this example, it is used the same issue as in the Autocomplete page. So it looks like in the following picture on edit:

 

  • Let's change the values for the fields Published and Not published, special created for this example. These fields have the ids: customfield_11900(Published) and customfield_11901(Not published). These are simple Jira custom fields, of type "Text Field (< 255 characters)".
  • Let's type in first "jjupin" for Published. When leaving Published input textbox, the values for Product Name and Product Id fields are dynamically changed to empty values, and the available list of values for Product Name is updated(this will be visible when trying to enter a new value by using autocomplete) depending on the values of the fields Published and Not published.

  • In the mean time we can type in a value for Not published as well(databasecf)
  • Let's now use the auto completion to see the values available for the main database custom field Product Name:

 

The only option left is the one displayed, which is equal with the value of Published.

  • On selection, the child database custom field is automatically filled in with the id of the selected product.

    Every database custom field has a default value: blank, displayed in a the field of type Select List as "None".

  • After saving the issue, the selected values for the custom fields can be seen in the view issue screen:

In a similar way, the dynamic query is used to retrieve values for a database custom field in a select list.

For the next example where the parent fields depend on each other, when one field changes, all of the dependent fields are changed:


Which means in the following screen that:

  • DatabasecfAAA depends on Published and has ChildAAA,
  • DatabasecfBBB depends on DatabasecfAAA and has ChildBBB,
  • Product Name depends on DatabasecfBBB and has Child Product Name,
  • Version depends on Product Name and has Child Version.

 

Changing Published field from jtest1 to jtest2, all the values are changed.

Note that if session expires, the autocomplete, or other requests will not be completed, but jira can update the issue if the password of the user is kept in memory.

  • No labels