I want to create a cloned Ticket from special tickets (identified by a special service).
So I listen for the ArticleCreate event, which works just fine. But when an attachment was attached to an article, I dont get it! I just get the "file-2" attachement which contains the body of the article.
This is how I try:
Code: Select all
my @OldTicketID = ($HistoryLines[-1]{'Name'} =~ m/(\d+)/);
print DATEI "Alte TicketID $OldTicketID[0].\n";
my %OrgArticle = $Self->{TicketObject}->ArticleFirstArticle(
TicketID => $OldTicketID[0],
);
print DATEI "Ich will das Attachement aus Article mit ID $OrgArticle{ArticleID}.\n";
my %AttIndex = $Self->{TicketObject}->ArticleAttachmentIndex(
ArticleID => $OrgArticle{ArticleID},
UserID => 1,
);
my $size = scalar keys %AttIndex;
print DATEI "$size Elemente im Hash.\n";
When I run the example outside the ArticleCreate event for any other articles which have an attachment, then everythings works fine.
So my suspect was, that in the moment, where the event is fired, the attachment is still not attached, but looking in Article.pm shows, that all attachments should already been processed before the event is fired.
Whats wrong here?
Cheers,
Joern