Edgewall Software

This page documents the 1.2 (latest stable) release. Documentation for other releases can be found here.

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: 26 [[TicketQuery(status=new&milestone=,count)]]
Number of new tickets: 1034 [[TicketQuery(status=new,count)]]
Number of reopened tickets: 13 [[TicketQuery(status=reopened,count)]]
Number of assigned tickets: 45 [[TicketQuery(status=assigned,count)]]
Number of invalid tickets: 1506 [[TicketQuery(status=closed,resolution=invalid,count)]]
Number of worksforme tickets: 1400 [[TicketQuery(status=closed,resolution=worksforme,count)]]
Number of duplicate tickets: 2167 [[TicketQuery(status=closed,resolution=duplicate,count)]]
Number of wontfix tickets: 961 [[TicketQuery(status=closed,resolution=wontfix,count)]]
Number of fixed tickets: 4353 [[TicketQuery(status=closed,resolution=fixed,count)]]
Number of untriaged tickets (milestone unset): 29 [[TicketQuery(status!=closed,milestone=,count)]]
Total number of tickets: 12039 [[TicketQuery(count)]]
Number of tickets reported or owned by current user: 1809 [[TicketQuery(reporter=$USER,or,owner=$USER,count)]]
Number of tickets created this month: 2 [[TicketQuery(created=thismonth..,count)]]
Number of closed Firefox tickets: 13 [[TicketQuery(status=closed,keywords~=firefox,count)]]
Number of closed Opera tickets: 12 [[TicketQuery(status=closed,keywords~=opera,count)]]
Number of closed tickets affecting Firefox and Opera: 1 [[TicketQuery(status=closed,keywords~=firefox opera,count)]]
Number of closed tickets affecting Firefox or Opera: 24 [[TicketQuery(status=closed,keywords~=firefox|opera,count)]]
Number of tickets that affect Firefox or are closed and affect Opera: 25 [[TicketQuery(status=closed,keywords~=opera,or,keywords~=firefox,count)]]
Number of closed Firefox tickets that don't affect Opera: 1 [[TicketQuery(status=closed,keywords~=firefox -opera,count)]]
Last 3 modified tickets: #13121, #13128, #5506 [[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 anonymous
Summary Add a new project summary module.

Format: list

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

This is displayed as:

#181
Wiki preview injects new lines
#204
request for colour legend (or something similar) for ticket groups in reports
#226
Ticket Dependencies
#239
Link to diff of specifik wiki change instead of the page itself
#351
All ticket modifications should be tracked in timeline
#413
Installing on Windows, drive other than C:
#450
Diffviewer should try to convert the text into utf-8.
#475
merging of similar tickets
#519
Python process sometimes hangs on Windows Server 2003
#529
IE 5-6 over HTTPS broken downloads

[[TicketQuery(id=123)]]

This is displayed as:

#123
No SQL error display

Format: compact

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

This is displayed as:

#181, #204, #226, #239, #351, #413, #450, #475, #519, #529

Format: count

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

This is displayed as:

10

Format: progress

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

This is displayed as:

defect

5 / 5

enhancement

2 / 2

task

1 / 1

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:

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 10947)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#13130 duplicate Unsupported database type "sqlite" with Mercurial 4.8.2 and mercurial 4.9 anton
Description

Hi,

I wanted to update my mercurial from 4.7.2 to something actual, so I tried mercurial 4.9 (mercurial-4.9-cp27-cp27m-win32.whl) and got the following errors:

 Warning:
 
 Error with navigation contributor "ImportModule"
 Error with navigation contributor "BrowserModule"
 Error with navigation contributor "AdminModule"
 Error with navigation contributor "SearchModule"
 Error with navigation contributor "RoadmapModule"
 Error with navigation contributor "QueryModule"
 Error with navigation contributor "ReportModule"
 Error with navigation contributor "TicketModule"
 Error with navigation contributor "TimelineModule"
 Error with navigation contributor "WikiModule"
 
 Trac Error
 
 Unsupported database type "sqlite"

OK, I said, so I go one mercurial version back and tried the same with mercurial 4.8.2 and got the following errors at (instead) of the login page:

 Warning:

 Error with navigation contributor "ImportModule"
 Error with navigation contributor "BrowserModule"
 Error with navigation contributor "AdminModule"
 Error with navigation contributor "SearchModule"
 Error with navigation contributor "RoadmapModule"
 Error with navigation contributor "QueryModule"
 Error with navigation contributor "ReportModule"
 Error with navigation contributor "TicketModule"
 Error with navigation contributor "TimelineModule"
 Error with navigation contributor "WikiModule"

 Trac Error
 
 Unsupported database type "sqlite"

I think you fixed the problem in #13100 but this fix seems to be for 1.0.0.9dev if I look in the changeset comment: "1.0.0.9dev: compatibility fix with Mercurial 4.8".

Or have I to wait for Trac 1.2.4 (or 1.4)?

#13123 fixed Travis builds broken for Python 2.6 Jun Omae Christian Boos
Description

Last night, the Travis builds for the stable branches failed because the Python 2.6 builds failed to install their required packages.

One of the last successful one was Build #354 / Job #3545.1:

DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting Genshi>=0.7
/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting lxml
Collecting twill==0.9.1
Collecting Pygments
  Using cached https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl
Collecting docutils
  Using cached https://files.pythonhosted.org/packages/50/09/c53398e0005b11f7ffb27b7aa720c617aba53be4fb4f4f3f06b9b5c60f28/docutils-0.14-py2-none-any.whl
Collecting textile
  Using cached https://files.pythonhosted.org/packages/dc/72/c4c0c86d27e1bd4027ae8881bb4ebd208d1232c8d091c0b2254fdc709d63/textile-3.0.3-py2.py3-none-any.whl
Collecting pytz
  Using cached https://files.pythonhosted.org/packages/f8/0e/2365ddc010afb3d79147f1dd544e5ee24bf4ece58ab99b16fbb465ce6dc0/pytz-2018.7-py2.py3-none-any.whl
Collecting Babel<2.6.0
  Using cached https://files.pythonhosted.org/packages/94/03/14e68ad12e771a79cf96792f7158d68a7b3d8c7b2badf39e9ef1f65b57d6/Babel-2.5.3-py2.py3-none-any.whl
Collecting html5lib>=0.999999999 (from textile)
  Using cached https://files.pythonhosted.org/packages/a5/62/bbd2be0e7943ec8504b517e62bab011b4946e1258842bc159e5dfde15b96/html5lib-1.0.1-py2.py3-none-any.whl
Requirement already satisfied: ordereddict>=1.1; python_version == "2.6" in /home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages (from textile)
Requirement already satisfied: six in /home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages (from textile)
Collecting webencodings (from html5lib>=0.999999999->textile)
  Using cached https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl
Installing collected packages: Genshi, lxml, twill, Pygments, docutils, webencodings, html5lib, textile, pytz, Babel
Successfully installed Babel-2.5.3 Genshi-0.7.1 Pygments-2.3.1 docutils-0.14 html5lib-1.0.1 lxml-4.2.5 pytz-2018.7 textile-3.0.3 twill-0.9.1 webencodings-0.5.1

We can see that the "older" packages are fetched from the cache.

The failing build says:

DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting Genshi>=0.7
/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting configobj
Collecting Pygments
  Using cached https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl
Collecting docutils
  Using cached https://files.pythonhosted.org/packages/50/09/c53398e0005b11f7ffb27b7aa720c617aba53be4fb4f4f3f06b9b5c60f28/docutils-0.14-py2-none-any.whl
Collecting textile
  Using cached https://files.pythonhosted.org/packages/dc/72/c4c0c86d27e1bd4027ae8881bb4ebd208d1232c8d091c0b2254fdc709d63/textile-3.0.3-py2.py3-none-any.whl
Collecting lxml
/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/16/4a/b085a04d6dad79aa5c00c65c9b2bbcb2c6c22e5ac341e7968e0ad2c57e2f/lxml-4.3.0.tar.gz (2.5MB)
    100% |████████████████████████████████| 2.5MB 560kB/s 
    Complete output from command python setup.py egg_info:
    This lxml version requires Python 2.7, 3.4 or later.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ER22wI/lxml/
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pkg_resources/__init__.py", line 967, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Babel<2.6.0' distribution was not found and is required by the application
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Package     Version 
----------- --------
argparse    1.4.0   
funcsigs    1.0.2   
mock        2.0.0   
nose        1.3.7   
numpy       1.11.2  
ordereddict 1.1     
pbr         1.10.0  
pip         9.0.1   
py          1.4.31  
pytest      3.0.3   
setuptools  28.8.0  
six         1.10.0  
wheel       0.30.0a0

As it's an all or nothing thing, Genshi is not installed due to the failure to install Babel.

There's probably a way to point to the archive directly.

#13120 duplicate Towards independence from a SQL database based design nick@…
Description

This is a design suggestion / question.

Have looked a lot for tool that allow me to combine knowledge from wiki and code.

Have been using Confluence for years and it is a great wiki but since removal of WikiText based syntax I find hard to think about this interlinking.

I believe Trac is unique due to its wiki centric design and has great support for both markdown and restructuredText.

Ideally it would be Git based - some wikis are - so that I can use regular files to edit knowledge, version control changes and process the pages with things like Laika.

I understand that Trac needs a database to provide for the ability to refactor/rename wiki pages while maintaining the interlinking.

My request is if it is somehow possible to export the wiki pages to external files (could be source controlled in Git) but/and still be able to "process" as if they were in the database.

For example I would like to generate a static website that looks just like the one served by the server but without the ability to edit.

Also, would like to use Laika to process these exported pages because of its great way to customize restructuredText (see http://planet42.github.io/Laika/extending-laika/extending-rst.html).

The gist of my ask, from a design standpoints, is for a way to abstract over the fact that pages are in the database and make it possible to work with them using the Trac core code, even if they are on disk.

Maybe there is no actual change required to core code and there is already a way to use the core Trac code/api somehow to generate such a static website and process externally?

Hope this is not too obscure. Please advise if and how I can clarify. Thanks Nick

1 2 3 4 5 6 7 8 9 10 11


See also: TracQuery, TracTickets, TracReports

Last modified 7 months ago Last modified on Jul 20, 2018, 2:54:29 AM
Note: See TracWiki for help on using the wiki.