Opened 9 years ago

Closed 6 years ago

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

Reported by: Owned by: anonymous Odd Simon Simonsen high XmlRpcPlugin critical Thijs Triemstra 0.11

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.

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

Forgot.

comment:3 Changed 8 years ago by Thijs Triemstra

Cc: Thijs Triemstra added; anonymous removed normal → high 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 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 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.

Closes #3988, #5445

Modify Ticket

Change Properties