Modify

Opened 15 years ago

Closed 13 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 Steffen Pingel)

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)

xmlrpcplugin.patch (5.8 KB) - added by anonymous 15 years ago.
ticket-creation-time.patch (1.6 KB) - added by Thijs Triemstra 15 years ago.

Download all attachments as: .zip

Change History (8)

Changed 15 years ago by anonymous

Attachment: xmlrpcplugin.patch added

comment:1 Changed 15 years ago by osimons

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() (using time_created), and and then allowing each successive update to specify a time_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.

comment:2 Changed 15 years ago by osimons

Owner: changed from Alec Thomas to osimons

Forgot.

Changed 15 years ago by Thijs Triemstra

Attachment: ticket-creation-time.patch added

comment:3 Changed 15 years ago by Thijs Triemstra

Cc: Thijs Triemstra added; anonymous removed
Priority: normalhigh
Severity: normalcritical

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 osimons

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 Steffen Pingel

Description: modified (diff)

I would consider adding a flag that indicates a forced update. I think all operations that modify state that is usually tracked by the repository should requires TICKET_ADMIN privileges (#5445, #5446, #5447).

comment:6 Changed 13 years ago by osimons

Resolution: fixed
Status: newclosed

(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.

Closes #3988, #5445

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.