Project Ticket Template Context

The following additional context variables are available in templates with a scope of Project Tickets, on top of the values listed in Template Context.

Important

When running document templates in testing from the document template editor the filter_assignments are set to "All", filter_labels are set to empty list, search_text is empty string, filtered_ids is an empty list and ticket_page is set to "All".

Name

Description

Example

project

A project reference. The root object from which Project properties and sub objects such as lists of Drafts or Tickets can be accessed.

The project variable is only available when the document template scope is of type Project Home or Project Tickets

{{ project.ProjectName }}

filter_assignments

The assignment filter selected in the ticket view that the document was generated from. Can be one of "All", "Unassigned" or "Assigned to me". Defaults to "All".

Assignments Filter : {{ filter_assignments }} {# All, Unassigned, Assigned to me #}

filter_labels

A list of labels which the ticket view is being filtered by. Empty list if view not being filtered by label.

{{ ", ".join(filter_labels) or 'None' }}

filtered_ids

Database ids of the records which are viewable in the ticket view that the document was generated from. This allows the document template author to report on just the tickets that the user has the view filtered to.

{% for ticket in project.ticket_set.filter(id__in=filtered_ids).order_by('iid') %}

search_text

The contents of the "search" box on the ticket view that the document was generated from

Active Search: {{ search_text or 'None' }}

ticket_page

The sub-page of the ticket view that the document was generated from. Can be "open", "closed" or "all"

Ticket Page: {{ ticket_page.title() }}