Opened 8 years ago

Closed 6 years ago

#3988 closed enhancement (fixed)

A ticket creation time and a change time can be specified.

Reported by: anonymous Owned by: Odd Simon Simonsen
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 8 years ago.
ticket-creation-time.patch (1.6 KB) - added by Thijs Triemstra 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by anonymous

Attachment: xmlrpcplugin.patch added

comment:1 Changed 8 years ago by Odd Simon Simonsen

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 8 years ago by Odd Simon Simonsen

Owner: changed from Alec Thomas to Odd Simon Simonsen


Changed 8 years ago by Thijs Triemstra

Attachment: ticket-creation-time.patch added

comment:3 Changed 8 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:
@@ -95,19 +95,28 @@

The attached patch fixes this problem for create() and update() in 1.0.5 trunk.

comment:4 Changed 8 years ago by Odd Simon Simonsen

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 8 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 6 years ago by Odd Simon Simonsen

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
as closed The owner will remain Odd Simon Simonsen.
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.