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: 2 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 18 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 1 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 3 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 0 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 9 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 25 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 34 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 239 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 2 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 603 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 68 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 0 [[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: #600, #598, #581 [[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 pasha ktk
Summary Cleanup compiler warnings

Format: list

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

This is displayed as:

No results

[[TicketQuery(id=123)]]

This is displayed as:

#123
Closing LID causes crash in acpidaemon + huge amounts of LID events

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 in 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 581)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#603 Unrelated OS/4 Compatibility diver
#602 duplicate Probleme mit Treibern der ISDN-Karte Eicon DIVA 2.01 PCI Professor
#600 fixed Unepected power off during boot; incorrect power readings; unexpected undocking behavior Lewis Rosenthal
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 581)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#603 Unrelated OS/4 Compatibility diver
Description

according to the OS/4 developer the following would be enough to be compatible with it.

In file 'krnlfix.c' function void KernelFix(void) in the very beginning there should be:

if ((ULONG)&_KernKEEVersion > 0x10000)
{
   Setup.SRKrnl = 1;
   KrnlVersion = 1;
   return;
}
#602 duplicate Probleme mit Treibern der ISDN-Karte Eicon DIVA 2.01 PCI Professor
Description

Der Treiber o.g. Karte verweigert den Start mit folgender Fehlermeldung:

ISDN Protocol driver TE_ETSI, Build 100-9, Protocol 6.03(V1) 99-4

Copyright Eicon Technology

DIVA 2.01 PCI found

Write to DIDD registry failed!

#600 fixed Unepected power off during boot; incorrect power readings; unexpected undocking behavior Lewis Rosenthal
Description

Hardware:

IBM ThinkPad T43
2.26GHz Pentium M 780 (single core)
2GB PC-4200 RAM
Intel 82801FBM ICH6-M southbridge
ATI Radeon X300

Software:

eCS 2.1 GA
14.106_SMP retail kernel
NO APM.SYS
NO VAPM.SYS
NO APMDAEMN.EXE
NO GSVDAEMN.EXE

Symptom:

Upon installing ACPI.PSD, while the system is still booted without any PSD loaded and while still running APM.SYS (10.163), system shuts down/powers off or goes down for reboot normally. The subsequent cold or warm boot loads the ACPI PSD, and the system boots normally. Upon then shutting down/powering off or rebooting, the subsequent boot fails, either before base device drivers begin loading (the kernel build string is still visible on-screen) or immediately after ACPIDAEMON starts. The failure is an abrupt power off. Subsequent reboots result in similar failures. Rebooting with no PSD and no APM.SYS are successful; however, until APM.SYS has been added back to CONFIG.SYS and the system successfully booted, ACPI will continue to display this behavior. Once successfully booted with APM.SYS active (ny editing CONFIG.SYS), the next reboot with ACPI and ACPIDAEMON will succeed, although rebooting or shutting down from that point will result in the original (unexpected power off) behavior.

ACPID.CFG:

Initially, there was no ACPID.CFG on this system. Creating one based on the sample file made no difference, and neither did specifically stating PowerButton = None (the power off event can happen long before ACPID.CFG is even read - before the IFS even loads to read any files in %ETC%).

Possibly-related symptoms:

When fully booted with ACPIDAEMON running, neither the system power object nor the Beer Battery widget are able to determine battery charge or correctly determine source. In the case of the widget, battery charge is consistently reported as 101% and on AC power (even when the system is running on battery), and the power object reports "unknown" both for power source and power state.

Finally, under normal circumstances (APM.SYS, APMDAEMN.EXE, and GSVDAEMN.EXE in CONFIG.SYS), when the system is docked (ThinkPad Dock II), the dock is locked. It is not possible to undock the machine while hot (under OS/2). Pressing the dock's release button produces a dull click, but does not release the button to its "up" position to allow it to be pressed to eject the machine - until power off, when the button will immediately snap up. Under ACPI, the button operates freely; the system does not behave as though docked. This might have some bearing on the battery state being unknown, as the system should detect that it is getting power from the docking connector, and if power is coming through the docking connector, then the system should properly "lock" to the dock.

Debug logs attached.

1 2 3 4 5 6 7 8 9 10 11


See also: TracQuery, TracTickets, TracReports

Last modified 6 weeks ago Last modified on Sep 24, 2024, 8:53:54 AM
Note: See TracWiki for help on using the wiki.