[rt-users] Deleting one attachment

Ram ram0502 at gmail.com
Mon Oct 24 19:45:22 EDT 2016


Inline..
> A user at work added an attachment that violates corporate policy to a
> ticket; the ticket itself is valid and must be kept. I need to delete the
> attachment. A quick look at the rt-shredder tool does not make it apparent
> to me how to do this with rt-shredder. I can readily do it editing the db
in
> mysql but I'd rather use rt-shredder if it will do the job.
> any help?

I'll be going with a direct DB edit which I'm documenting here for the next
person. Since I just want to suppress the file and do not want to hide the
fact that it existed. Here is what I did, be very careful! If you don't
know SQL or you don't understand every step below then find someone else to
help you - this is the WRONG PATH for you:

1 Get the attachment id of the attachment to remove (as of RT 4.4.1  it's
the *second* number in the URL that displays the attachment).

2 Add a comment to the ticket indicating that you are deleting the
offending attachment for policy violation (or whatever you motive).

3 Run this command to improve your odds of not messing up and deleting the
wrong transaction:
> select id, Transactionid, MessageId, Subject, Filename, ContentType,
ContentEncoding, Headers, Creator, Created from Attachments where id=
ATTACHMENT_ID_FROM_STEP_1 \G

4 If that looks right to you then run this SQL against A TEST COPY OF YOUR
DB to ensure you are killing the right attachment
> update Attachments set Content = NULL where id =
ATTACHMENT_ID_FROM_STEP_1 limit 1;

5 Go look at the ticket in RT and ensure that you did indeed eliminate the
offending attachment.

6 Repeat steps 3,4,5 in your production environment.

7 Do not call me if you shot yourself in the foot. No warranty expressed or
implied!

If this isn't perfectly clear, hire Best Practical (
https://bestpractical.com/)  to do it for you.

cheers,

Ram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20161024/88fe855d/attachment.htm>


More information about the rt-users mailing list