Opened 6 years ago

Closed 3 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 Trac Release: 0.11

Description (last modified by stp)

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 6 years ago.
ticket-creation-time.patch (1.6 KB) - added by thijs 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by anonymous

comment:1 Changed 5 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 5 years ago by osimons

  • Owner changed from athomas to osimons


Changed 5 years ago by thijs

comment:3 Changed 5 years ago by thijs

  • Cc thijs added
  • Priority changed from normal to high
  • Severity changed from normal to 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:
@@ -95,19 +95,28 @@

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

comment:4 Changed 5 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 5 years ago by stp

  • 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 3 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to 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.

Closes #3988, #5445

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.