Edgewall Software
Modify

Opened 13 years ago

Last modified 13 years ago

#10250 new enhancement

tracQuery does not support count

Reported by: hamsteg@… 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.

Attachments (0)

Change History (2)

comment:1 by hamsteg@…, 13 years ago

forgot: for those interested, in python with XMLRPC the solution is to gather all IDs:

Code highlighting:

pr.count = len(trac.server.ticket.query("type=PR&max=0"))

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.

comment:2 by Christian Boos, 13 years ago

Milestone: unscheduled

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.