WordPress.org

Make WordPress Core

wiki:TracQuery

Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, which can be used to display tickets that meet specified 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 in and no name/email is 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 dropdown 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 dropdown menu of options can be added multiple times to perform an Or on the criteria.

For text fields such as Keywords and CC the - operator can be used to negate a match and double quotes (since 1.2.1) can be used to match a phrase. For example, a contains match for word1 word2 -word3 "word4 word5" matches tickets containing word1 and word2, not word3 and word4 word5.

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.

After you have edited your filters, click the Update button to refresh your results.

Keyboard shortcuts are available for manipulating the checkbox filters:

  • Clicking on a filter row label toggles all checkboxes.
  • Pressing the modifier key while clicking on a filter row label inverts the state of all checkboxes.
  • Pressing the modifier key while clicking on a checkbox selects the checkbox and deselects all other checkboxes in the filter. Since 1.2.1 this also works for the Columns checkboxes.

The modifier key is platform and browser dependent. On Mac the modified key is Option/Alt or Command. On Linux the modifier key is Ctrl + Alt. Opera on Windows seems to use Ctrl + Alt, while Alt is effective for other Windows browsers.

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

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

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#49219 invalid feed.php calls apply_filters with too many arguments bret.miller
#49209 worksforme Site health issue due to issues in processing wp_remote_retrieve_body aparnascodex
#49208 invalid no more edition ebooklibris.com ebooklibris
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>:

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

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#49219 invalid feed.php calls apply_filters with too many arguments bret.miller
Description

feed.php calls apply filters like this:

return apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show );

But in class-wp-hook, apply_filters only accepts 2 parameters. So when filters are called for get_bloginfo_rss, they get the text, but not what was requested making it very hard to acutally create a meaningful filter.

It needs to be changed to

return apply_filters( 'get_bloginfo_rss', array(convert_chars( $info ), $show) );

so that both items are passed to the filter.

#49209 worksforme Site health issue due to issues in processing wp_remote_retrieve_body aparnascodex
Description

I have activated one plugin on my site which results in 'Background updates are not working as expected'.

I found that, the code to validate the http response is not working as expected.

if ( 'yes' !== $response) then show warning. (file class-wp-site-health-auto-updates.php)

On debugging the issue, I found that the function wp_remote_retrieve_body is returning 'yes' as response. But, I guess some space is returning with response because of which the above condition is failing. If I change the condition to if ( 'yes' !== trim($response)), then it works fine.

#49208 invalid no more edition ebooklibris.com ebooklibris
Description

Hi

I can't edit anymore with my WP web site. I send you the code I copy when I updated the PHP resources ` ### WordPress Environment ###

WordPress address (URL): http://ebooklibris.com Site address (URL): http://ebooklibris.com WC Version: 3.8.1 REST API Version: ✔ 1.0.2 Log Directory Writable: ✔ WP Version: 5.3.2 WP Multisite: – WP Memory Limit: ❌ 40 MB - We recommend setting memory to at least 64MB. See: Increasing memory allocated to PHP WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: –

### Server Environment ###

Server Info: Apache PHP Version: 5.6.40 - We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version PHP Post Max Size: 6 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.38.0 OpenSSL/1.0.1t

SUHOSIN Installed: – MySQL Version: ❌ 5.5.60-0+deb7u1-log - We recommend a minimum MySQL version of 5.6. See: WordPress requirements Max Upload Size: 64 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔

### Database ###

WC Database Version: 3.8.1 WC Database Prefix: i078g5pssf Total Database Size: 135.05MB Database Data Size: 102.78MB Database Index Size: 32.27MB i078g5pssfwoocommerce_sessions: Data: 0.16MB + Index: 0.01MB + Engine MyISAM i078g5pssfwoocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_order_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwoocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_accounts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_btg: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_categories: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_feeds: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_feed_templates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_feed_tpl_data: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_feed_tpl_values: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_jobs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_listings: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_markets: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_orders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_payment: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_profiles: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_reports: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_shipping: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfamazon_stock_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_activity: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_bank_transfer_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_email_templates: Data: 0.01MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_entries: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_fail_attempts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_forms: Data: 0.08MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_form_field: Data: 0.03MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_lockdown: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_login_history: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_members: Data: 1.33MB + Index: 0.92MB + Engine MyISAM i078g5pssfarm_membership_setup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_member_templates: Data: 0.01MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_payment_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_subscription_plans: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfarm_termmeta: Data: 1.15MB + Index: 0.83MB + Engine MyISAM i078g5pssfblc_filters: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfblc_instances: Data: 0.07MB + Index: 0.02MB + Engine MyISAM i078g5pssfblc_links: Data: 0.54MB + Index: 0.07MB + Engine MyISAM i078g5pssfblc_synch: Data: 0.00MB + Index: 0.01MB + Engine MyISAM i078g5pssfcommentmeta: Data: 1.52MB + Index: 0.47MB + Engine InnoDB i078g5pssfcomments: Data: 2.48MB + Index: 0.81MB + Engine InnoDB i078g5pssflinks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfoptions: Data: 2.52MB + Index: 0.20MB + Engine MyISAM i078g5pssfpostmeta: Data: 46.58MB + Index: 11.00MB + Engine InnoDB i078g5pssfposts: Data: 27.52MB + Index: 6.05MB + Engine InnoDB i078g5pssftermmeta: Data: 1.52MB + Index: 0.64MB + Engine InnoDB i078g5pssfterms: Data: 1.52MB + Index: 0.81MB + Engine InnoDB i078g5pssfterm_relationships: Data: 1.52MB + Index: 1.50MB + Engine InnoDB i078g5pssfterm_taxonomy: Data: 1.52MB + Index: 0.61MB + Engine InnoDB i078g5pssfusermeta: Data: 4.25MB + Index: 3.20MB + Engine MyISAM i078g5pssfusers: Data: 1.54MB + Index: 1.22MB + Engine MyISAM i078g5pssfvisual_form_builder_entries: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfvisual_form_builder_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfvisual_form_builder_forms: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwc_product_meta_lookup: Data: 0.13MB + Index: 0.26MB + Engine MyISAM i078g5pssfwc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM i078g5pssfwc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwp2ap_aff_links: Data: 0.01MB + Index: 0.01MB + Engine MyISAM i078g5pssfwp2ap_cloaked_links: Data: 6.67MB + Index: 3.62MB + Engine MyISAM i078g5pssfwpmm_subscribers: Data: 0.00MB + Index: 0.00MB + Engine MyISAM i078g5pssfwp_email_capture_temp_members: Data: 0.00MB + Index: 0.00MB + Engine MyISAM mycbgenie_cron_sync_master: Data: 0.02MB + Index: 0.00MB + Engine InnoDB mycbgenie_custom_edited_products: Data: 0.02MB + Index: 0.00MB + Engine InnoDB mycbgenie_fresh_import_products_master: Data: 0.02MB + Index: 0.00MB + Engine InnoDB mycbgenie_fresh_import_product_details: Data: 0.02MB + Index: 0.00MB + Engine InnoDB mycbgenie_manual_sync_products_master: Data: 0.02MB + Index: 0.00MB + Engine InnoDB

### Security ###

Secure connection (HTTPS): ❌

Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.

Hide errors from visitors: ✔

### Active Plugins (30) ###

a3 Lazy Load: by a3rev Software – 2.2.0 Social Media Widget by Acurax: by Acurax – 3.2.10 Ad Inserter: by Igor Funa – 2.6.1 Clickbank Affiliate Ads By MyCBGenie: by MyCBGenie.com – 1.9 Akismet Privacy Policies: by Inpsyde GmbH – 1.1.2 Akismet Anti-Spam: by Automattic – 4.1.3 ARMember Lite: by Repute InfoSystems – 1.9 Broken Link Checker: by ManageWP – 1.11.10 ClickBank Sale Notification: by Purwedi Kurniawan – 0.120508 Clickbank Storefronts: by CBproAds.com – 1.2.0 Contact Form 7: by Takayuki Miyoshi – 5.1.6 Jetpack by WordPress.com: by Automattic – 8.1 HubSpot All-In-One Marketing - Forms, Popups, Live Chat: by HubSpot – 7.18.81 MC4WP: Mailchimp for WordPress: by ibericode – 4.7.4 MyCBGenie Clickbank Storefront Plugin: by MyCBGenie.com – 1.4 – Not tested with the active version of WooCommerce Advanced Social Pixel: by NsThemes – 2.0.1 Really Simple CAPTCHA: by Takayuki Miyoshi – 2.0.2 Regenerate Thumbnails Advanced: by ShortPixel – 2.1.0 The Events Calendar: by Modern Tribe Inc. – 4.9.14

The Post Grid: by RadiusTheme – 2.3.2 ThemeGrill Demo Importer: by ThemeGrill – 1.6.1 Visual Form Builder: by Matthew Muro – 3.0.1 WooCommerce PayPal Checkout Gateway: by WooCommerce – 1.6.18 WooCommerce Stripe Gateway: by WooCommerce – 4.3.1 WooCommerce Services: by Automattic – 1.22.2 WooCommerce: by Automattic – 3.8.1 WP Email Capture: by Winwar Media – 3.7.1 WP-Lister Lite for Amazon: by WP Lab – 1.0.5 – Not tested with the active version of WooCommerce WP Maintenance Mode: by Designmodo – 2.2.4 Insert Code by Angie Makes: by Chris Baldelomar – 1.2

### Inactive Plugins (8) ###

Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.10.3 MailPoet 2: by MailPoet – 2.13 NextGEN Gallery: by Imagely – 3.2.23 TinyMCE Advanced: by Andrew Ozz – 5.3.0 WF Cookie Consent: by wunderfarm – 1.1.4 WP-Matomo: by André Bräkling – 1.0.22 wp2affiliate: by wp2affiliate – 0.01.35 WP Assistant: by 1&1 – 5.2.0

### Must Use Plugins (1) ###

1&1 Product Subdomain: by 1&1 – 1.1.0

### Settings ###

API Enabled: ✔ Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5)

Connected to WooCommerce.com: –

### WC Pages ###

Shop base: ❌ Page ID is set but the page does not exist

Cart: ❌ Page ID is set but the page does not exist

Checkout: ❌ Page ID is set but the page does not exist

My account: ❌ Page ID is set but the page does not exist

Terms and conditions: ❌ Page not set

### Theme ###

Name: Social Magazine Version: 1.9.1 Author URL: https://www.themesmatic.com Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ❌ Not declared

### Templates ###

Overrides: –

### Action Scheduler ###

Complete: 86 Oldest: 2020-01-16 08:59:32 +0000 Newest: 2020-01-16 09:01:33 +0000

Pending: 0 Oldest: – Newest: –

Canceled: 0 Oldest: – Newest: –

In-progress: 0 Oldest: – Newest: –

Failed: 0 Oldest: – Newest: –

`thanks for your help

corinne valtremont

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. Filters are separated by ampersands (&). Each filter 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

Filters combining matches and negated matches can be constructed for text fields such as Keywords and CC when using the contains (~=) operator. The - operator is used to negate a match and double quotes (since 1.2.1) are used for whitespace-separated words in a phrase. For example, keywords~=word1 word2 -word3 "word4 word5" matches tickets containing word1 and word2, not word3 and also word4 word5.

status=closed,keywords~=firefox query closed tickets that contain keyword firefox
status=closed,keywords~=opera query closed tickets that contain keyword opera
status=closed,keywords~=firefox opera query closed tickets that contain keywords firefox and opera
status=closed,keywords~=firefox|opera query closed tickets that contain keywords firefox or opera
status=closed,keywords~=firefox,or,keywords~=opera query closed tickets that contain keyword firefox, or (closed or unclosed) tickets that contain keyword opera
status=closed,keywords~=firefox -opera query closed tickets that contain keyword firefox, but not opera
status=closed,keywords~=opera -firefox query closed tickets that contain keyword opera, but no firefox

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 omitted 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

Note that modified is the last modified time, so modified with a date range shows ticket that were last modified in that date range. If a ticket was modified in the date range, but modified again after the end date, it will not be included in the results.


See also: TracTickets, TracReports, TracGuide, TicketQuery

Last modified 22 months ago Last modified on 04/11/2018 02:13:58 AM