How to use a Variable with a Data Source
Understanding Variables and Their Significance
Variables are essential placeholders within data sources, offering significant power and flexibility for a wide range of functions. They allow you to transmit contextual details of an Issue to your data source, which then utilizes this information to generate the desired output or enhancing the flexibility of an existing data source to avoid the redundant creation of similar data sources.
How to create a Variable?
Variables can be used as placeholders within configurations. Variables are defined using a specific syntax, surrounding the variable name with curly brackets ({}
), to denote where the dynamic content will be inserted later on. In the following example {var1}
is the variable:
https://myapi.com?query={var1}
Where can a Variable be used?
Field | Data Source | Variable |
---|---|---|
URL |
| ✅ |
Post Body |
| ✅ |
SQL Query |
| ✅ |
How to send User Input to a Data Source via a Variable
Here, we will demonstrate how to use a variable to send a search term to a data source through Field Configuration (Extension Search External). If you haven't installed the Extension yet, this example can also be replicated using a standard external search field.
How to send User Input to a Data Source via a Variable
How to use a Variable to improve Data Source Reusability
In this example, we will use a variable instead of a fixed JQL query. This approach makes the data source reusable for different JQL queries, eliminating the need to duplicate the data source multiple times.
How to use a Variable to improve Data Source Reusability