wiki:TracQuery

Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.

Filters

When you first go to the query page the default filter will display tickets relevant to you:

  • If logged in then all open tickets it will display open tickets assigned to you.
  • If not logged in but you have specified a name or email address in the preferences then it will display all open tickets where your email (or name if email not defined) is in the CC list.
  • If not logged and no name/email defined in the preferences then all open issues are displayed.

Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the pulldown lists at the bottom corners of the filters box ('And' conditions on the left, 'Or' conditions on the right). Filters with either a text box or a pulldown menu of options can be added multiple times to perform an or of the criteria.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

Once you've edited your filters click the Update button to refresh your results.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.

Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.

Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria (see Query Language).

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Using the [[TicketQuery]] Macro

The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.

Example:

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

This is displayed as:

#8
test
#57
remove profile picture, links from left column on index page
#74
Main page with static parts, wrong image link etc.
#75
Inconsistencies in page layout, especially number of columns
#82
[test] signup.php sql error
#85
Move old BW-mainpage to application "Rox"
#105
Signup page - Improve handling of invalid user input
#176
Members per Country don't appear on Algeria
#186
Spam protection for Trac
#201
Signup problem
#237
mailbox broken when you have 21 messages
#257
you can easily write positive comments without meeting the person you write about
#295
Port member-pages to platformPT (members.php,editmyprofile.php,comments.php,mypreferences.php,...)
#297
Create Gmail-like Ajax-chat for our whole website
#317
location selector query logic
#343
MySQL error and code showing in forum
#429
Multiple Popup in Volunteers board
#447
short generic URLs e.g. bewelcome.org/people/guaka
#456
Login redirect on test.bw and alpha.bw in Firefox and Internet Explorer
#497
Lost password page should send a link to change the password
#518
Signup process : "why not check password with JS ?"
#608
Replace the flags in the footer by spelled names for language selection
#610
support for left to right languages (Hebrew, Arabic)
#612
bw forum search function
#634
translation tool
#662
bug report - images not displaying correctly
#680
Broken profiles on ALPHA
#681
logged out while writing forum posts
#698
bug report
#851
bug report
#1109
can't read msgs
#1111
cannot delete pictures from gallery
#1152
Allow for creating group admins
#1157
Create group relationships feature
#1168
bug report - display age
#1177
bug report
#1186
"View forum posts" broken on profiles
#1197
Email: tab "sent" Information about user is not correct
#1217
bug report
#1265
When you start a new topic from the group overview page, they are not connected to the group
#1266
Provide a way for the treasurer of BeWelcome to add manually description for new donation
#1269
comments - wrong time stamp
#1280
HTML tags are displayed in notification
#1290
Accommodation setting at member search result
#1310
"add a note" function
#1424
page after login: profile picture / empty pic - encouragement to upload photo
#1429
my notes functionality is messy
#1436
map search - members cant be found
#1480
Bug report : number of members
#1531
Users from small towns don't appear on the map
#1553
Description for relations not shown.
#1556
Make postal code optional
#1561
Editing of a group post disconnect it from its group.
#1603
change group admin / groupsettings
#1605
unexpected "New topic" button for the groups I don't belong
#1606
broken "Add a note" function
#1609
buttons break in some languages
#1706
Display the number of unread messages on the my messages icon
#1735
Tags and Visibility changes to existing Thread have no effect
#1749
"Reply" button disappears on forum pages when zooming in and out in Chrome
#1762
Forums should not be visible if not logged in
#1792
one member can't change his profile summary
#1817
Better notification for new messages
#1826
Wrong text on blogs headers
#1831
show recent comments
#1841
Spurious 'member' in all search results
#1937
update Khyber Pakhtunkhwa wrong region name
#1943
Include successor states of Nethelands Antilles in list of countries
#1969
Separate overview for forum and group threads
#1971
Remove editing option for tags
#1977
Privacy setting for trips do not work at all
#2005
profile translation disappeared
#2014
String ActivityJoinTheFun is misleading
#2071
Next visitors should show visitors in a wider area
#2140
Two word codes can have exact same name
#2156
Improve AdminFAQ
#2161
permalinks don't work when thread is more than 1 page long.
#2193
Visibility of threads in a group
#2197
Don't send messages when a translation is added
#2283
failing migrations on the developer database dump

Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language. This also allows displaying the link and description of a single ticket:

[[TicketQuery(id=123)]]

This is displayed as:

#123
Blog and other Apps of TB produce XML-parsingerror-pages

A more compact representation without the ticket summaries is also available:

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

This is displayed as:

#8, #57, #74, #75, #82, #85, #105, #176, #186, #201, #237, #257, #295, #297, #317, #343, #429, #447, #456, #497, #518, #608, #610, #612, #634, #662, #680, #681, #698, #851, #1109, #1111, #1152, #1157, #1168, #1177, #1186, #1197, #1217, #1265, #1266, #1269, #1280, #1290, #1310, #1424, #1429, #1436, #1480, #1531, #1553, #1556, #1561, #1603, #1605, #1606, #1609, #1706, #1735, #1749, #1762, #1792, #1817, #1826, #1831, #1841, #1937, #1943, #1969, #1971, #1977, #2005, #2014, #2071, #2140, #2156, #2161, #2193, #2197, #2283

Finally, if you wish to receive only the number of defects that match the query, use the count parameter.

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

This is displayed as:

80

Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field> - you can specify multiple fields and what order they are displayed by placing pipes (|) between the columns like below:

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

This is displayed as:

Results (1 - 3 of 1586)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#2283 duplicate failing migrations on the developer database dump lantti
#2275 invalid Fast Systems Of Linux VPS - The Best Routes SamaraBothwell
#2269 worksforme Footer in the middle of comment page railslide railslide
1 2 3 4 5 6 7 8 9 10 11

Full rows

In table format you can also have full rows by using rows=<field> like below:

[[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 1586)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#2283 duplicate failing migrations on the developer database dump lantti
Description

Some of the wordcodes that should be added by running migrations are already present in the words.sql database dump. This causes the migrations to fail. The workaround that I used to continue with my install was replacing the INSERT INTO queries in the tools/roxmigration/roxmigration.php/_writeWordCodeToDb() function with REPLACE INTO queries. This way the query succeeds even if there is already an identical wordcode in the database.

Should we make this change to the official code too? Is there a reason why we would like to have a fatal error instead of silent replacement in such a conflict between the existing wordcode and a migration? Or would it be better to fix the developer db dump instead?

#2275 invalid Fast Systems Of Linux VPS - The Best Routes SamaraBothwell
Description

Windows VPS Vs Linux VPS

There are many decisions to make for hosting right this moment for your rising amount of people and corporation who need a web property. You'll uncover quite a few hosting choices that happen to be wonderful for numerous web-site specifications. Web-site entrepreneurs who experience additional than normal website visitors on their own web-sites normally choose Linux and Windows VPS hosting with regards to demands. It includes a larger bandwidth and disk capacity which could deal with the surge of activity these kinds of websites enjoy. It is additionally perfect for net builders with quite unique programming adjustments for his or her personal developments.

Any vps hosting operates by partitioning a particular hosting server right into several servers collectively with aid of virtual application together with microcomputers. These kind of virtual dedicated server hosting can be a mediated journey between shared enviroment together with devoted servers related to web hosting service, offering their possible clients self-reliance as effectively finding a lot significantly less than hosting.

Hence, virtual dedicated server hosting is usually deemed an excellent bridge between dedicated and shared enviroment system. A large number of hosting customers prefer Linux vps over other kinds of hosting today because doing so provides them with with greater control in contrast to shared enviroment. Even when companies work well from the shared enviroment system and do not want the extra resources offered inside vps hosting system, the more control may be worth the additional expense. Windows vps is an excellent starter package for anyone companies which use dedicated server hosting, but they are cautious about the technological difficulties linked to it.Like with other hosting, vps hosting also holds many perks. In contrast to a separate server hosting system, Linux vps might turn out to be cheaper to people and businesses. Secondly, the plans of vps might be customized to fulfill the requirements people. This means that men and women pay only for they can be using which enables it to get rid of the features they just don't need. In addition, the majority of the virtual dedicated server hosting plans is scalable.

Selecting the best hosting company for Linux VPS can be a decision that you will must invest a while in. If you are searching for reliability then Linux could be a great solution for you personally since Windows doesn't provide 100% uptime. Just because web site hosting, VPS hosting provides flexibility, better control and functionality in the highly secured manner as well as resource sharing.

1 particular gets bogged together with the above offered individual computer programs program lingo and will get disappointed through specifics of thinking about hosting and virtual private portion web hosting service in addition to windows committed servers. It could be significantly much easier to view the thought of getting some sort of vps hosting through the pursuing explanation. It's in simple terms an easy method of linking several desktops to merely 1 single mom laptop or computer. Through this process distinct users will sustain unbiased records regarding the main individual computer even although implementing the respective computer system systems with the significant pc program. They will all utilize identical webpage link all of which access the exact same principal computer nonetheless without getting interfering or maybe any info around the other recent users.

#2269 worksforme Footer in the middle of comment page railslide railslide
Description

The footer doesn't stick to the bottom of comment page (e.g. http://www.bewelcome.org/members/Railslidetest/comments/add), covering part of the form and making impossible to leave a comment for another member.

1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values. To include a literal & or | in a value, escape the character with a backslash (\).

The available operators are:

= the field content exactly matches one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be left out to avoid having to quote the query string.

created=2007-01-01..2008-01-01 query tickets created in 2007
created=lastmonth..thismonth query tickets created during the previous month
modified=1weekago.. query tickets that have been modified in the last week
modified=..30daysago query tickets that have been inactive for the last 30 days

See also: TracTickets, TracReports, TracGuide

Last modified 3 years ago Last modified on Jul 27, 2014 9:54:49 PM