Modify

Opened 8 years ago

Closed 6 years ago

#5445 closed enhancement (fixed)

Ability to specify the author for ticket comments/updates

Reported by: Thijs Triemstra Owned by: Odd Simon Simonsen
Priority: high Component: XmlRpcPlugin
Severity: major Keywords:
Cc: Thijs Triemstra, seniorsamu, Thomas Moschny Trac Release: 0.11

Description

Currently it's not possible to specify the author of a comment when using ticket.update(). It basically always uses the name of the user that invoked the xml-rpc call. When trying to reconstruct a ticket database this is obviously not an acceptable solution. See attached patch for a fix.

Attachments (2)

author-update.patch (1.3 KB) - added by Thijs Triemstra 8 years ago.
t5445-ticket_update_author-r9818.diff (4.1 KB) - added by Odd Simon Simonsen 6 years ago.
Same strategy, but adds author without breaking API + includes test.

Download all attachments as: .zip

Change History (16)

Changed 8 years ago by Thijs Triemstra

Attachment: author-update.patch added

comment:1 Changed 7 years ago by Thijs Triemstra

Ping :)

comment:2 Changed 7 years ago by Thijs Triemstra

Type: defectenhancement

comment:3 Changed 7 years ago by Odd Simon Simonsen

#7284 closed as duplicate. That also has a longer description of why this is a good idea, and also contains what looks like a nice patch.

I haven't looked into either patch yet, unfortunately.

comment:4 Changed 7 years ago by seniorsamu

Does it have any chance to make into the trunk soon? It is just a slight modification with no obvious impact on the core functionality but introducing a new function.

I checked both patches, they are pretty much the same.

comment:5 Changed 7 years ago by seniorsamu

Cc: seniorsamu added

comment:6 Changed 7 years ago by anonymous

Ticket 7881 has some bearing upon this.

comment:7 Changed 6 years ago by Odd Simon Simonsen

See also #5447 that requests the same for ticket attachments.

comment:8 Changed 6 years ago by Thomas Moschny

Cc: Thomas Moschny added

To me the patch from #7284 looks nicer, because it doesn't change the signature of the ticket.update() call.

comment:9 Changed 6 years ago by anonymous

I badly need this fix. Any idea on when I can expect this?

comment:10 in reply to:  6 Changed 6 years ago by Odd Simon Simonsen

Replying to anonymous:

Ticket #7881 has some bearing upon this.

Right, it does. It notes that the original patch fails to update the accepted RPC request signatures for the updated update() method.

Changed 6 years ago by Odd Simon Simonsen

Same strategy, but adds author without breaking API + includes test.

comment:11 Changed 6 years ago by Odd Simon Simonsen

I've added an updated patch that uses same strategy to add a new parameter for author.

I've considered separate argument vs adding 'author' to attributes, and in the end decided that I prefer the explicit approach for an argument that is really not an attribute of the ticket - only of the individual update. Hiding it inside attributes just because it may look cleaner is not ideal, but when added as last optional argument the end-result is the same (-> no breaking changes).

BTW, not reflected in the patch but I'll update the version to 1.1.1 to make it easy to detect if this feature is present.

Good to go?

comment:12 Changed 6 years ago by Thomas Moschny

I did not test the patch, but from reading: shouldn't it default to req.authname instead of '', when the optional author argument is not present?

comment:13 Changed 6 years ago by Thomas Moschny

Oh, it does, in line 174. Sorry.

comment:14 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
Action
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.