Opened 13 years ago
Last modified 13 years ago
#10250 new enhancement
tracQuery does not support count
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | unscheduled |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
tracQuery can be used in either Wiki or the Report interface. The last can also be used by XMLRPC.
From the manual:
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 (\). … In addition to filters, several other named parameters can be used to control how the results are presented. All of them are optional.
Within the Wiki I can perform
Code highlighting:
[[TicketQuery(status=new,count)]]
And it will return a number.
The report though, as noted, behaves differently.
Code highlighting:
query:?status=new,count
Will result in an empty table. I find this strange for a report; especially count and sum are important reporting statistics.
Proposal: If count and/or sum are somewhere in the query behind selection criteria, only sum and/or count marked results will be returned in a single row for those marked fields.
Code highlighting:
query:?status=new,count&status=closed,count
Could result in:
| New # | Closed # | | 10 | 300 |
Sum might be handy for custom fields, eg. Estimate Time to Complete sum for activities with a certain state.
Please make this feature also XMLRPC proof.
forgot: for those interested, in python with XMLRPC the solution is to gather all IDs:
Code highlighting:
max=0 is important and also the reason for requesting the count and sum functions. Somewhere there is a limit in transporting all ticket ID data to the client. It is also not necessary if the count ans sum are implemented. Data transport will then significantly be reduced.