Opened 16 years ago
Closed 14 years ago
#3988 closed enhancement (fixed)
A ticket creation time and a change time can be specified.
Reported by: | anonymous | Owned by: | osimons |
---|---|---|---|
Priority: | high | Component: | XmlRpcPlugin |
Severity: | critical | Keywords: | |
Cc: | Thijs Triemstra | Trac Release: | 0.11 |
Description (last modified by )
I created the patch to which the following functions were added.
It enables it to specify the date when performing the addition or updating of a ticket via XML-RPC plug-in. In addition, it unites and enables it to also specify the date at the time of registering an attached file.
Attachments (2)
Change History (8)
Changed 16 years ago by
Attachment: | xmlrpcplugin.patch added |
---|
comment:1 Changed 15 years ago by
Changed 15 years ago by
Attachment: | ticket-creation-time.patch added |
---|
comment:3 Changed 15 years ago by
Cc: | Thijs Triemstra added; anonymous removed |
---|---|
Priority: | normal → high |
Severity: | normal → critical |
This is quite an important feature for my plugin. I solved this problem in XmlRpcPlugin 1.0 by using this patch:
- def create(self, req, summary, description, attributes = {}, notify=False): + def create(self, req, summary, description, when, attributes = {}, notify=False): """ Create a new ticket, returning the ticket ID. """ t = model.Ticket(self.env) t['status'] = 'new' @@ -83,7 +83,7 @@ t['reporter'] = req.authname or 'anonymous' for k, v in attributes.iteritems(): t[k] = v - t.insert() + t.insert(to_datetime(when)) if notify: try: @@ -95,19 +95,28 @@
The attached patch fixes this problem for create()
and update()
in 1.0.5 trunk.
comment:4 Changed 15 years ago by
Adding time_created
to attributes on ticket creation should not be a major issue. For time_changed
however, see comment:ticket:5402:5 for discussion.
I'm not all that keen on changing method signatures as I then would need either new update2/create2
methods, or enforce some stringent version handling that ensures clients use the correct version of the api. Putting things in attributes
is much more flexible.
comment:5 Changed 15 years ago by
Description: | modified (diff) |
---|
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [9911]) XmlRpcPlugin: Add ability to create and update tickets from author other than the user making request, and at a timestamp other than 'now'. Added extra permission checks for both changes (admin only).
Thanks to all those that have contributed patches and feedback for these issues.
Hmm. This is something that needs to be considered for the ongoing work on #5402 that in latest patch adds the
time_changed
field as a safety for avoiding overwriting newer updates with stale data. Recent changes and ongoing work on the plugin kind of conflicts with the idea of storing arbitrary data on a ticket.Perhaps it can be adjusted to allow it for
create()
(usingtime_created
), and and then allowing each successive update to specify atime_changed
as long as it is newer than the currently latest (and storing the value, not just for collision detection). That would allow importing ticket history from elsewhere in a clean manner.