How make Attachments sorted in ticket metadata

In the ticket metadata that can be rolled up or down on Display.html
is a section for listing File Attachments that have been put in the
ticket. To me, it seems that these files are not sorted in
alphabetical, date, transactionId or attachmentID order. Seems to be
in random order.

I am looking at Elements/ShowAttachments and Elements/FindAttachments
to see how I could force them to be sorted by creation date but can;t
figure it out. FindAttachments seems to send them up the chain in
order of AttachmentId, but as soon as they get into ShowAttachments’
%documents array, they are all jumbled up.

Does anyone know how to get the file Attachments listed in some kind of order?

Allen

Hashes are random.

Changing
foreach my $key (keys %documents)
to
foreach my $key (sort keys %documents)

would sort by filename

RT appears to already sort multiple versions of a file by date.
Cambridge Energy Alliance: Save money. Save the planet.