Opened 11 years ago

Closed 9 years ago

## #5445 closed enhancement (fixed)

Reported by: Owned by: Thijs Triemstra osimons high XmlRpcPlugin major Thijs Triemstra, seniorsamu, Thomas Moschny 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.

Ping :)

### comment:2 Changed 10 years ago by Thijs Triemstra

Type: defect → enhancement

### comment:3 Changed 9 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 9 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:6 follow-up:  10 Changed 9 years ago by anonymous

Ticket 7881 has some bearing upon this.

### comment:8 Changed 9 years ago by Thomas Moschny

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

### comment:9 Changed 9 years ago by anonymous

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

### comment:10 in reply to:  6 Changed 9 years ago by osimons

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

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

### comment:11 Changed 9 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 9 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 9 years ago by Thomas Moschny

Oh, it does, in line 174. Sorry.

### comment:14 Changed 9 years ago by osimons

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