After fetching and filtering your data, the last step is to configure how it's displayed in the Jira issue.
Elements Connect uses templates based on Apache FreeMarker to format the retrieved data into readable content, from simple text like ${row.name} to output combining multiple fields and conditional logic.
Template
Templates define how the data retrieved from your data source is displayed in the connected custom field. Each row of your result set is passed through the template you provide.
Process:
-
A query retrieves a result set
-
A template formats it into text or select options
For select lists, you can use the following template:
${row.name}
You can combine multiple fields into a single option label:
${row.name} — ${row.department} (${row.email})
For read-only fields, you can use the following template:
${data.name}
Learn a lot more in our Template guide.
Template for table fields
Defining template for table fields works exactly the same. You have to define one template per column. Then, you have a bit more options to customize your look & feel.
-
You can define a name for each column
-
You can add column with the + add column action at the bottom (max 5)
-
You can remove columns (clicking on X) or change column order clicking on ↑ or ↓
Besides, tables are currently limited to 10 lines by default. If you want less, you can set up the max suggestions option accordingly.
Once everything is ok, your table should look like this in your issues.
If you changed the order of your columns in your field configuration but did not updated your issues using e.g. post functions, you may not get the same mapping in create/edit or JQL search view.
Frequently asked questions
What is a template in Elements Connect?
A template is the format used to display data retrieved from your data source in a Jira connected custom field. Elements Connect templates are based on Apache FreeMarker.
What's the difference between row and data in templates?
In select-list fields (single or multiple choice), each option is generated from a row of your result set, so you reference properties with row.property. In read-only fields, the retrieved data is a single object, so you reference properties with data.property.
Can I combine multiple fields in a single template?
Yes. You can reference multiple properties from the same row or data object, and combine them with static text or FreeMarker directives.
Does the template output refresh automatically when the source data changes?
Only for Object storage type fields with Live update enabled. Snapshot fields freeze the display value at selection time, while Live update refreshes the template output each time the issue is viewed.