Skip to main content
Skip table of contents

The Default Template

The default template of PocketQuery produces a simple Jira table. The result looks like this:

The table has two columns Name and Population, according to the SELECT clause of the query. 

Templates for PocketQuery are written in Velocity, a Java templating language used in Jira. Let’s have a look at the code of the default PocketQuery template that is selected by default for all queries.

CODE
<table class="aui pocketquery-table">
    <thead>
    <tr>
        #foreach ($column in $columns)
            <th>$!column</th>
        #end
    </tr>
    </thead>
 
    <tbody>
        #foreach ($row in $result)
        <tr>
            #foreach ($column in $row)
                <td>$!column</td>
            #end
        </tr>
        #end
    </tbody>
</table>

Nothing fancy here: there is one loop for the header that runs through the column names and one loop (with another nested loop) running through the result. Note that the variables $columns and $result are passed to any PocketQuery template, so you can use them as you please. For a more formal specification of what kind of objects are available in PocketQuery templates, see the PocketQuery documentation on templates.

Continue with Custom CSS To Highlight Particularly High/Low Values

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.