[rt-users] Merge Ticket with existing ticket with the same subject

rmp dmd rmp.dmd1229 at gmail.com
Thu Aug 13 10:47:31 EDT 2009


Hi,

I'm using the scrip below to merge newly created ticket with existing ticket
with the same subject. However, im getting

Scrip 36 Commit failed: Can't modify non-lvalue subroutine call at (eval
1311) line 21.

code for line 21 is :
$ticket->Subject = $same_desc;

Im not exactly sure what the error means. Please help in making the scrip
work.


Thanks!



====

my $problem_desc = undef;
my $Transaction = $self->TransactionObj;
my $subject = $Transaction->Attachments->First->GetHeader('Subject');
$problem_desc = $subject;
$RT::Logger->debug("This is the subject to match: $problem_desc");
# look for subject on existing tickets
my $search = RT::Tickets->new($RT::SystemUser);
$search->LimitQueue(VALUE => 'IT');
$search->LimitStatus(VALUE => 'new', OPERATOR => '=', ENTRYAGGREGATOR =>
'or');
$search->LimitStatus(VALUE => 'open', OPERATOR => '=');
if ($search->Count == 0) { return 1; }
my $id = undef;
my $same_desc = undef;
while (my $ticket = $search->Next) {
    # Ignore this ticket that opened this transaction
    next if $self->TicketObj->Id == $ticket->Id;
    $ticket->Subject = $same_desc;
    if ($same_desc eq $problem_desc){
       # Found the same subject
       $RT::Logger->debug("SAME $same_desc and $problem_desc");
       $id = $ticket->Id;
       $RT::Logger->debug("Merging ticket " . $self->TicketObj->Id . " into
$id because of OA number match.");
       $self->TicketObj->MergeInto($id);
    }
}
$id || return 1;
1;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090813/08635085/attachment.htm>


More information about the rt-users mailing list