Ticket #4019 (closed defect: fixed)
[PATCH] - Ticket Api does not contain 'time' and 'changetime' fields
| Reported by: | ilias@… | Owned by: | rblank |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | created lastmodified |
| Cc: | mjs@…, goncha@… |
Description (last modified by cboos) (diff)
source:trunk/trac/ticket/api.py@3935#L88
The attached patch introduces the fields 'time' and 'changetime' to the ticket api.
This enables e.g. sorting on those fields within queries (ticket-query-macro).
(sidenote: "'type': 'text'" can be possibly changed later e.g. to "datetime", in order to allow formatting of the values within the UI)
context: http://dev.lazaridis.com/base/wiki/PlanTicketQueryMacro
Attachments
Change History
comment:1 follow-up: ↓ 2 Changed 4 years ago by cmlenz
I've not tried the patch, but doesn't this mean those fields are going to be displayed among the other form fields on the newticket/ticket pages?
comment:2 in reply to: ↑ 1 Changed 4 years ago by ilias@…
Replying to cmlenz:
I've not tried the patch, but doesn't this mean those fields are going to be displayed among the other form fields on the newticket/ticket pages?
yes, you are right.
I guess I've missinterpreted the meaning of "Ticket Api".
comment:3 Changed 4 years ago by ilias@…
The Query uses "TicketSystem?(self.env).get_ticket_fields()" to get the ticket fields:
source:trunk/trac/ticket/query.py#rev=3935#L51
'time' and 'changetime' are missing, thus ordering does not work.
possibly changing get_ticket_fields() to
get_ticket_fields(all=false)
This would keep existent behaviour, but would return those missing fields on request (setting all=true).
or alternatively
get_ticket_fields(for_gui=True)
would this be ok?
Changed 4 years ago by ilias@…
- attachment TicketApiAddMissingFieldsOptional.diff added
patch with added option "all_fields"
comment:4 follow-ups: ↓ 5 ↓ 7 Changed 4 years ago by mgood
I'm -1 on this. The get_ticket_fields function is intended for fields that should be user-editable. The Ticket model class has attributes time_created and time_changed for accessing that information. I don't have problem with the query supporting filtering or sorting by the creation or changed date/time, but I don't think it requires adding those to get_ticket_fields.
comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 4 years ago by ThurnerRupert <rupert.thurner@…>
Replying to mgood:
I'm -1 on this. The get_ticket_fields function is intended for fields that should be user-editable. The Ticket model class has attributes time_created and time_changed for accessing that information. I don't have problem with the query supporting filtering or sorting by the creation or changed date/time, but I don't think it requires adding those to get_ticket_fields.
what would you suggest to get all tickest closed in the last week/month? or the tickets closed by user x in the last month?
comment:6 in reply to: ↑ 5 ; follow-up: ↓ 9 Changed 4 years ago by ilias@…
Replying to ThurnerRupert <rupert.thurner@gmail.com>:
what would you suggest to get all tickest closed in the last week/month? or the tickets closed by user x in the last month?
An answer to this would go out of the scope of this ticket, which is just the inclusion of the 'time' and 'changetime' fields into the 'get_ticket_fields' function.
see further comments within:
http://groups.google.com/group/trac-dev/msg/7c9edb15d47434bb
a summary: include the fields into "get_ticket_fields" and ensure that systems using this function ignore the fields that they cannot handle.
I'll try to post a followup patch which covers the "add-filter" issue.
comment:7 in reply to: ↑ 4 Changed 4 years ago by ilias@…
Replying to mgood:
I'm -1 on this. The get_ticket_fields function is intended for fields that should ...
due to temporary problems with trac-anti-spam, comment here:
http://groups.google.com/group/trac-dev/msg/78fc1a819c87ea9f
Changed 4 years ago by ilias@…
- attachment TicketQueryMissingFieldsByMgood.diff added
Patch provided by mgood
comment:8 Changed 4 years ago by ilias@…
please ignore the last attached file (TicketQueryMissingFieldsByMgood?.diff), as the patch does not work.
comment:9 in reply to: ↑ 6 Changed 4 years ago by ilias@…
Replying to ilias@lazaridis.com:
I'll try to post a followup patch which covers the "add-filter" issue.
comment:11 Changed 3 years ago by cboos
- Keywords created lastmodified added
- Description modified (diff)
- Milestone set to 0.11
comment:12 Changed 2 years ago by cboos
- Cc goncha@… added
- Milestone changed from 0.11.2 to 0.12
The latest patch related to #2288 also addresses this.
comment:13 follow-up: ↓ 14 Changed 23 months ago by cboos
- Owner changed from jonas to rblank
Fixed I believe?


