Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Step 1: Choose the datasource

To retreive retrieve data, you will need first to connect to the database that store stores data for you. Choosing the right datasource will made make the connection between the customfield and the database.

...

After choosing the datasource and the customfield type (we assume that you choose autocomplete as customfield type). You will need now to fulfill the configuration with a working query. The query must first work and retreive retrieve data on your DBMS.

To illustrate properly how it works we will try to implement a real use case :

...

A simple select query will retreive retrieve cities from the table city  :


Column Alias : When using an alias for the main column. If no alias then it must be the same as the column name.

Column name : The name of the main column

Loading data : Please choose automatique Automatique for autocomplete

Nomber Number of caracter character to start search : The number of taped character characters before autocomplete startstarted.

Number of the element to return : The number of elements to return as a result of the autocompletion.

...

Here is the result after entering «ben» :


Step 3:

...

Retrieve more data

Childs will help you to retreive retrieve more data into issues. It's pretty simple to work with childs. You must know that there are no special customfield to create you can use JIRA customfield as Text, Date, number, etc.

For our exemple example, the need have has been modified. So now, we need to select an id and depending on this id we will retreive retrieve the name of the city :


Query: The query must contain all the columns that you want to retreiveretrieve.

Column Alias: Explained by the use of an alias for the main column  column: city_id as 'id'

And here is the result :

...

Suppose now that our database contains two table tables as below:


Country
Country_id
Country

...

City
City_id
City
Country_id

So the need now is to retreive retrieve country for each selected city. Here's the new configuration :

...

Info
iconfalse

It's possible to join two or more tables. It's important to know that if the query works on your DBMS it will also work on the customfield configuration except when :

  • Using ORDER BY you must add in the where clause: column name like '%' in our exemple example the query become becomes:
Bloc de code
select city,country from city c inner join country co on c.country_id = co.country_id where city like '%' order by c.city_id


...