Modify

Opened 5 years ago

Closed 3 years ago

#5445 closed enhancement (fixed)

Ability to specify the author for ticket comments/updates

Reported by: thijs Owned by: osimons
Priority: high Component: XmlRpcPlugin
Severity: major Keywords:
Cc: thijs, seniorsamu, thm 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 5 years ago.
t5445-ticket_update_author-r9818.diff (4.1 KB) - added by osimons 3 years ago.
Same strategy, but adds author without breaking API + includes test.

Download all attachments as: .zip

Change History (16)

Changed 5 years ago by thijs

comment:1 Changed 5 years ago by thijs

Ping :)

comment:2 Changed 4 years ago by thijs

  • Type changed from defect to enhancement

comment:3 Changed 4 years ago by osimons

#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 4 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 4 years ago by seniorsamu

  • Cc seniorsamu added

comment:6 follow-up: Changed 4 years ago by anonymous

Ticket 7881 has some bearing upon this.

comment:7 Changed 3 years ago by osimons

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

comment:8 Changed 3 years ago by thm

  • Cc thm added

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

comment:9 Changed 3 years ago by anonymous

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

comment:10 in reply to: ↑ 6 Changed 3 years ago by osimons

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

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

comment:11 Changed 3 years ago by osimons

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

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

Oh, it does, in line 174. Sorry.

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

Action
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'.
Author


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

 
Note: See TracTickets for help on using tickets.