Restricting to one attachment per ticket

In order to sync the life cycle of attachments and tickets, we are
exploring the idea of restricting to just one the number of attachment
for a given ticket.

Has anyone done that? Where would be a good starting point?

Thanks,
Thierry Thelliez

Thierry,

That would be more difficult than you might think. Each email in RT’s
ticket history is represented by a transaction with one or more
attachments. For example one email may have an html part and a plain
text part, each of which is actually stored as an attachment.

You probably want to allow one “file” attachment per ticket. You may
be able to do this by counting the number of ticket transaction
attachments that have a non-null filename in the attachments table
before creating a new attachment. You would have to customize the
email gateway or email parser to do this. You could also remove the
file upload from the web interface if the ticket already has an
attachment.

Ultimately this is doable but will require some careful, custom coding.On Wed, Aug 3, 2011 at 7:19 PM, Thierry Thelliez thierry.thelliez.tech@gmail.com wrote:

In order to sync the life cycle of attachments and tickets, we are
exploring the idea of restricting to just one the number of attachment
for a given ticket.

Has anyone done that? Where would be a good starting point?

Thanks,
Thierry Thelliez


2011 Training: http://bestpractical.com/services/training.html

Thierry,

Todd makes good points about the difficulty of this, but the suggestion
to count based on non-null filenames probably wouldn’t work in reality.
Many folks have images, vcards, etc automatically attached to their
outgoing email for branding purposes. Sometimes these images are inline
and don’t have a filename, but just as often they do have a filename,
which RT dutifully records. One correspondence with such a signature,
and there goes your file upload limit.

I’d wager that there are better ways to attack your problem.

Thomas

Thanks for your answers.

The use case is that end users are submitting forms as attachments.
This works fine until they want to submit updates to these forms. Some
are submitting a new ticket with the updated form, some are just
adding an attachment (updated form) to an old ticket. Since we are
associating the form status with the ticket status, it becomes
confusing to have multiple forms in one ticket. For example the first
submitted form could have wrong data, when a second form could be
correct.

I was thinking of creating a scrip ‘On Correspond’ checking for
existing attachments. Since the forms are expected to be Excel-like,
we could count only the .xls(s,m) and .csv. We would then reject a
new correspondence if it comes with an attachment AND if we already
have one Excel-like file.

I am not an expert in Perl/RT. Any piece of code to help me started
would be really appreciated.
Thanks,
Thierry