wiki:TicketQuery

TicketQuery Wiki Macro

The TicketQuery macro lets you display ticket information anywhere that accepts WikiFormatting. The query language used by the [[TicketQuery]] macro is described in the TracQuery page.

Usage

[[TicketQuery]]

Wiki macro listing tickets that match certain criteria.

This macro accepts a comma-separated list of keyed parameters, in the form "key=value".

If the key is the name of a field, the value must use the syntax of a filter specifier as defined in TracQuery#QueryLanguage. Note that this is not the same as the simplified URL syntax used for query: links starting with a ? character. Commas (,) can be included in field values by escaping them with a backslash (\).

Groups of field constraints to be OR-ed together can be separated by a literal or argument.

In addition to filters, several other named parameters can be used to control how the results are presented. All of them are optional.

The format parameter determines how the list of tickets is presented:

  • list -- the default presentation is to list the ticket ID next to the summary, with each ticket on a separate line.
  • compact -- the tickets are presented as a comma-separated list of ticket IDs.
  • count -- only the count of matching tickets is displayed
  • rawcount -- only the count of matching tickets is displayed, not even with a link to the corresponding query (since 1.1.1)
  • table -- a view similar to the custom query view (but without the controls)
  • progress -- a view similar to the milestone progress bars

The max parameter can be used to limit the number of tickets shown (defaults to 0, i.e. no maximum).

The order parameter sets the field used for ordering tickets (defaults to id).

The desc parameter indicates whether the order of the tickets should be reversed (defaults to false).

The group parameter sets the field used for grouping tickets (defaults to not being set).

The groupdesc parameter indicates whether the natural display order of the groups should be reversed (defaults to false).

The verbose parameter can be set to a true value in order to get the description for the listed tickets. For table format only. deprecated in favor of the rows parameter

The rows parameter can be used to specify which field(s) should be viewed as a row, e.g. rows=description|summary

The col parameter can be used to specify which fields should be viewed as columns. For table format only.

For compatibility with Trac 0.10, if there's a last positional parameter given to the macro, it will be used to specify the format. Also, using "&" as a field separator still works (except for order) but is deprecated.

Examples

Example Result Macro
Number of Triage tickets: 0 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 10 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 0 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 5 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 22 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 0 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 0 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 0 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 550 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 0 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 858 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 0 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 13 [[TicketQuery(created=thismonth..,count)]]
Number of closed Firefox tickets: 0 [[TicketQuery(status=closed,keywords~=firefox,count)]]
Number of closed Opera tickets: 0 [[TicketQuery(status=closed,keywords~=opera,count)]]
Number of closed tickets affecting Firefox and Opera: 0 [[TicketQuery(status=closed,keywords~=firefox opera,count)]]
Number of closed tickets affecting Firefox or Opera: 0 [[TicketQuery(status=closed,keywords~=firefox|opera,count)]]
Number of tickets that affect Firefox or are closed and affect Opera: 0 [[TicketQuery(status=closed,keywords~=opera,or,keywords~=firefox,count)]]
Number of closed Firefox tickets that don't affect Opera: 0 [[TicketQuery(status=closed,keywords~=firefox -opera,count)]]
Last 3 modified tickets: #858, #857, #856 [[TicketQuery(max=3,order=modified,desc=1,compact)]]

Details of ticket #1:

[[TicketQuery(id=1,col=id|owner|reporter,rows=summary,table)]]

Ticket Owner Reporter
#1 alx alx
Summary Клонировать endpoint'ы платы VE-01

Format: list

[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]

This is displayed as:

No results

[[TicketQuery(id=123)]]

This is displayed as:

#123
Хочется кнопку Отменить в "Обновлении SW"

Format: compact

[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]

This is displayed as:

No results

Format: count

[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]

This is displayed as:

0

Format: progress

[[TicketQuery(milestone=0.12.8&group=type,format=progress)]]

This is displayed as:

Format: table

You can choose the columns displayed in the table format (format=table) using col=<field>. You can specify multiple fields and the order they are displayed by placing pipes (|) between the columns:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Results (1 - 3 of 843)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#858 fixed 4С-37: сломался чекбокс блокировки alx san
#857 fixed Доработка окна платы 4C-37 alx san
#855 fixed Добавить новую прошивку платы RT-01 alx ledol
1 2 3 4 5 6 7 8 9 10 11

Full rows

In table format you can specify full rows using rows=<field>:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 843)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#858 fixed 4С-37: сломался чекбокс блокировки alx san
Description

После выполнения #857 сломался чекбокс блокировки

  1. Открываю окно платы
  2. Снимаю чекбокс блокировка с портов 1, 2, 5, 6, нажимаю Применить и закрываю окно
  3. Снова открываю окно платы и ожидаю увидеть в 1, 2, 5, 6 снятый чекбокс

Однако, для портов 2, 5, 6 чекбокс блокировка установлен.

r2725

#857 fixed Доработка окна платы 4C-37 alx san
Description

Доработка окна платы 4C-37 Плата 4C-37 наконец-то из концептуальной разработки стала законченным продуктом. Требуется изменить веб-интерфейс и бэкэнд в соответствии с реальным функционалом платы, чтобы можно было передать её пользователям.

  1. Плата не поддерживает(и не будет) функцию резервирования потоков E1:
  • 1.1 убрать взаимодействие интерфейса с переменными .10.0, .11.0
  • 1.2 убрать из окна платы столбец Резервирование
  1. Плата в текущей прошивке и в ближайшее время не поддерживает функцию передачи плезиохронных потоков E1 в кросс:
  • 2.1 Настройку "Плезиохронный поток" всегда записывать в значение выкл(чекбокс снят)
  • 2.2 Удалить из окна платы столбцы Плезиохронный поток, Выбор шины для стаффинга, Позиция стаффинга
  1. На текущий момент плата поддерживает только режим работы "Режим переприема C37-E1". На портах 1 и 2 чекбокс "Режим переприема C37-E1" должен быть всегда установлен и задизейблен для пользователя, в плату всегда записывается установленное значение чекбокса.
  1. При включенном чекбоксе "Режим переприема C37-E1" порта 1, настройки "Позиция TDM" портов 1 и 5 игнорируются (не проверяются конфликты и не отображается цветная строка на вкладке TDM). Аналогично при включенном чекбоксе "Режим переприема C37-E1" порта 1, настройки "Позиция TDM" портов 2 и 6 игнорируются.
  1. Настройки "Число каналов C37-94" для портов 5 и 6 должна отсутствовать (у портов E1 нет такой настройки)
  1. Порты 3 и 4 платы пока не работают
  • 6.1 Нужно задизэйблить строки этих портов, поставить чекбокс заблокирован и в плату всегда записывать что порт заблокирован
  • 6.2 Ячейки столбца "Состояние" для портов 3 и 4 отображать серым цветом.
  1. Т.к. чекбоксы "Режим переприема C37-E1" всегда включены а порты 3 и 4 не работают, то столбец "Позиция TDM" не используется в настройке платы и его нужно спрятать от пользователя (позже, для следующих прошивок плат возможно он понадобится).
  1. Освободившаяся в п.1 переменная .10.0 используется теперь для других целей в байте 0 хранится значение регистра настроек "mode":
      [6,5] =1: контроль по CRC-4 в приёмнике E1_1/E1_2 отключить
        [4] =1/0: порт C37_1 подключен к TDM/E1_1, порт E1_1 - к TDM/C37_1
        [3] =1/0: порт C37_2 подключен к TDM/E1_2, порт E1_2 - к TDM/C37_2
      [1:0] =0..3: режим синхронизации от pclk/clk65m/E1/несинхр.
    
  • 8.1 Настройки "Режим переприема C37-E1" теперь хранятся в другом месте - бит 3(порт 2) и бит 4(порт 1) байта 0 переменной .10.0. Значение бита 0 - чекбокс установлен.
  • 8.2 В группу настроек "Синхронизация" нужно добавить новую настройку: "Источник", с вариантами "Генератор", "E1", "Несинхронный". Значение хранится в битах 0,1 байта 0 переменной .10.0. "Генератор" - 1, "E1" - 2, "Несинхронный" -3. По умолчанию "Несинхронный".
  • 8.3 В таблицу нужно добавить столбец "CRC-4" для портов 5 и 6 в столбце должны быть чекбоксы. Бит 6(порт 5) и бит 5(порт 6) байта 0 переменной .10.0. Значение бита 0 - чекбокс установлен. По умолчанию чекбокс снят.

p.s. Описание переменных платы было здесь ticket:747#attachment:4C-37_Mib_V3.txt Также в качестве дополнительной информации прилагаю "тз" на ПО платы и описание регистров ПЛИС

#855 fixed Добавить новую прошивку платы RT-01 alx ledol
Description

RT-01 исполнение 2 ревизия 2

1 2 3 4 5 6 7 8 9 10 11


See also: TracQuery, TracTickets, TracReports

Last modified 4 years ago Last modified on Nov 26, 2022, 2:15:34 PM
Note: See TracWiki for help on using the wiki.