Hi Tony,<div>i think the problem is <span style="font-family:'Courier New';font-size:13px;border-collapse:collapse;color:rgb(68, 68, 68)">my $link = $self->TicketObj->DependedOnBy->Next; which gives you back all possible DependedOnBy Tickets, also if you have more. I tried something similar last week. </span></div>

<div><font color="#444444" face="'Courier New'"><span style="border-collapse:collapse"><br></span></font></div><div><span style="font-size:13px"></span><font color="#444444" face="'Courier New'"><span style="border-collapse:collapse">Attached a piece of code to find all deponby tickets and update the deponbys with something.</span></font></div>

<div><font color="#444444" face="'Courier New'"><span style="border-collapse:collapse"><br></span></font></div><div><font color="#444444" face="'Courier New'"><span style="border-collapse:collapse"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; ">my $DepOnBy = $self->TicketObj->DependedOnBy;<br>
my $dep;<br>my $l;<br>while( $dep = $DepOnBy->Next ) {<br>       next unless( $dep->BaseURI->IsLocal );<br>       my $systicket = RT::Ticket->new($RT::SystemUser);<br>       $systicket->Load($dep->BaseObj->Id);<br>
       my $Members = $systicket->Members;<br>       while( $l = $Members->Next ) {<br>       next unless( $l->TargetURI->IsLocal );<br>               next unless( $l->BaseObj->Queue =~ /^(?:1043|612|613)$/ );<br>
               $self->TicketObj->AddLink(Type=>'MemberOf',Base=>$l->BaseObj->Id);<br>       }<br>}<br>return 1;</span></span></font></div><div><font class="Apple-style-span" color="#444444" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font color="#444444" face="'Courier New'"><span style="border-collapse:collapse"><span class="Apple-style-span" style="font-size: 13px; "></span><font class="Apple-style-span" face="arial, sans-serif">In my case i added to all deponby tickets a new member, you can replace this with your setdue part i think,</font></span></font></div>
<div><font color="#444444" face="'Courier New'"><span style="border-collapse:collapse"><font class="Apple-style-span" face="arial, sans-serif"><br>Torsten<br></font>
</span></font><br><div class="gmail_quote">2009/11/25 TONY JOHN - ERS, HCL Tech <span dir="ltr"><<a href="mailto:tonyjohn@hcl.in" target="_blank">tonyjohn@hcl.in</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">










<div lang="EN-US" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Hi ,</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">I’m trying to set the Due date  of  the child Ticket.But
my scrips is giving some error.Please find below  the Custom action clean up
code used for the same:</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">my $link =
$self->TicketObj->DependedOnBy->Next;</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">my $duedate = RT::Date->new($RT::SystemUser);</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">my $hours_duetime = 24;</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">$duedate->Set(Format=>'unix', Value=>$hours_duetime);</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">$self->TicketObj->SetDue($duedate->ISO);</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">$link->BaseObj->SetDue($duedate->ISO); </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">return 1;</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""> </span></font></p>

<p class="MsoNormal"><u><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">Error : Log File</span></font></u></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">[Wed Nov 25 09:08:30 2009] [debug]: Committing scrip
#11 on txn #114748 of ticket #1972
(/usr/lib/perl5/vendor_perl/5.10.0/RT/Scrips_Overlay.pm:190)</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New"">[Wed Nov 25 09:08:30 2009] [error]: Scrip 125 Commit
failed: Can't call method "BaseObj" on an undefined value at (eval
1531) line 8.</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""> </span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Any help?</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Regards,</span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Tony</span></font></p>

</div>

</div>



<table><tbody><tr><td bgcolor="#ffffff"><font color="#000000"><pre>DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. 
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. 
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have 
received this email in error please delete it and notify the sender immediately. Before opening any mail and 
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------</pre></font></td></tr></tbody></table>
<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" target="_blank">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><br clear="all"><br>-- <br>MFG<br><br>Torsten Brumm<br><br><a href="http://www.brumm.me" target="_blank">http://www.brumm.me</a><br>

<a href="http://www.elektrofeld.de" target="_blank">http://www.elektrofeld.de</a><br>
</div>