hi<div><br></div><div>try using <span class="Apple-style-span" style="font-family: monospace; font-size: 13px; white-space: pre; ">$TicketObj->SetSubject() function,</span></div><div><span class="Apple-style-span" style="font-size: 13px; "></span><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; white-space: normal; "><pre>
$TicketObj->Subject is just an accessor method</pre><pre>Rémi</pre></span></span></font><div><br><div class="gmail_quote">2009/8/13 rmp dmd <span dir="ltr"><<a href="mailto:rmp.dmd1229@gmail.com">rmp.dmd1229@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Hi,</div>
<div> </div>
<div>I'm using the scrip below to merge newly created ticket with existing ticket with the same subject. However, im getting</div>
<div> </div>
<div>Scrip 36 Commit failed: Can't modify non-lvalue subroutine call at (eval 1311) line 21.</div>
<div> </div>
<div>code for line 21 is : </div>
<div>$ticket->Subject = $same_desc;</div>
<div> </div>
<div>Im not exactly sure what the error means. Please help in making the scrip work. </div>
<div> </div>
<div> </div>
<div>Thanks!</div>
<div> </div>
<div> </div>
<div> </div>
<div>====</div>
<div> </div>
<div>my $problem_desc = undef;</div>
<div>my $Transaction = $self->TransactionObj;<br>my $subject = $Transaction->Attachments->First->GetHeader('Subject');</div>
<div>$problem_desc = $subject;<br>$RT::Logger->debug("This is the subject to match: $problem_desc");</div>
<div># look for subject on existing tickets <br>my $search = RT::Tickets->new($RT::SystemUser);<br>$search->LimitQueue(VALUE => 'IT');<br>$search->LimitStatus(VALUE => 'new', OPERATOR => '=', ENTRYAGGREGATOR => 'or');<br>
$search->LimitStatus(VALUE => 'open', OPERATOR => '=');</div>
<div>if ($search->Count == 0) { return 1; }<br>my $id = undef;<br>my $same_desc = undef;<br>while (my $ticket = $search->Next) {<br> # Ignore this ticket that opened this transaction <br> next if $self->TicketObj->Id == $ticket->Id;<br>
$ticket->Subject = $same_desc;<br> if ($same_desc eq $problem_desc){<br> # Found the same subject <br> $RT::Logger->debug("SAME $same_desc and $problem_desc"); <br> $id = $ticket->Id;<br>
$RT::Logger->debug("Merging ticket " . $self->TicketObj->Id . " into $id because of OA number match.");<br> $self->TicketObj->MergeInto($id);<br> } <br>}</div>
<div>$id || return 1;<br>1;<br> <br></div>
<br>_______________________________________________<br>
<a href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users" target="_blank">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><br>
<br>
Community help: <a href="http://wiki.bestpractical.com" target="_blank">http://wiki.bestpractical.com</a><br>
Commercial support: <a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a><br>
<br>
<br>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.<br>
Buy a copy at <a href="http://rtbook.bestpractical.com" target="_blank">http://rtbook.bestpractical.com</a><br></blockquote></div><br></div></div>