Template variables
Template variables allow you to create dynamic, reusable dashboards. Instead of hard-coding values like project names, assignees, or sprint names in your queries, you can use variables that appear as drop-down selectors at the top of your dashboard.
For general information about template variables in Grafana, refer to Variables.
Add a query variable
Query variables are populated dynamically from your Jira data. To add a Jira query variable:
- Open your dashboard and click Dashboard settings (gear icon).
- Select Variables in the left menu.
- Click Add variable.
- Enter a name for the variable (for example,
projectorassignee). - Select Query as the variable type.
- Select your Jira data source from the Data source drop-down.
- Configure the query:
- Select Field: Choose the field to populate the variable (for example, Project, Assignee, or Sprint Name)
- Filter (JQL): Optionally filter the results with a JQL query
- Click Apply.
Example: Create a project variable
To create a variable that lists all projects:
- Name:
project - Select Field: Project
- Filter (JQL): (leave empty to show all projects)
Use the variable in your queries:
project = '$project'Example: Create an assignee variable
To create a variable that lists assignees for a specific project:
- Name:
assignee - Select Field: Assignee
- Filter (JQL):
project = '$project'
Use the variable in your queries:
project = '$project' AND assignee = '$assignee'Use multi-value variables
Multi-value variables allow users to select multiple options. When using multi-value variables in JQL, use the IN operator:
assignee IN ($assignee)The Jira data source automatically formats multi-value selections for JQL. For example, if a user selects “Alice” and “Bob”, the query becomes:
assignee IN ('Alice','Bob')To enable multi-value selection:
- Open the variable settings.
- Under Selection options, enable Multi-value.
- Optionally enable Include All option to add an “All” selection.
Time range macros
The Jira data source provides macros that reference the dashboard time range. Use these macros to filter issues based on the selected time window.
Example: Filter issues by creation date
To show issues created within the dashboard time range:
project = '$project' AND created >= $__timeFrom AND created <= $__timeToExample: Filter issues by resolution date
To show issues resolved within the dashboard time range:
project = '$project' AND resolved >= $__timeFrom AND resolved <= $__timeToVariable syntax
You can reference variables in your JQL queries using the following syntax:
For more information about variable syntax, refer to Variable syntax.



