<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>I think I've founded the problem.</DIV>
<DIV>The CF was moved from queues to Global so that all queues have an access to this CF.</DIV>
<DIV> </DIV>
<DIV>I need to make some tests, but I think that it changes below want to resolve my problem.</DIV>
<DIV>Is this the correct way ? Or maybe have you a better suggestion ?</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">my $trans = $self->TransactionObj;<BR>my $ticket = $self->TicketObj;<BR>my $myCfName = "Qualification sécurité";</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">$RT::Logger->debug('***************************************');</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">if ($trans->Type eq 'CustomField') {<BR> my $cf = new RT::CustomField($RT::SystemUser);<BR> $cf->LoadById($trans->Field);<BR> ##return 0 unless $cf->id;<BR>...</FONT></DIV>
<DIV><FONT face="Courier New">...</FONT></DIV>
<DIV><FONT face="Courier New"> if ($cf->Name == $myCfName && $trans->NewValue eq "Oui") {</FONT></DIV>
<DIV><FONT face="Courier New"> ...</FONT></DIV>
<DIV><FONT face="Courier New"> ...<BR></FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> </DIV>
<DIV><BR></FONT>>>> Le Lundi, 8. Novembre 2010 à 19:11, Kevin Falcone <falcone@bestpractical.com> a écrit :<BR></DIV>
<TABLE style="MARGIN: 0px 0px 0px 15px; FONT-SIZE: 1em" border=0 bgColor=#f3f3f3>
<TBODY>
<TR>
<TD>
<DIV style="BORDER-LEFT: #050505 1px solid; PADDING-LEFT: 7px">On Fri, Nov 05, 2010 at 02:09:33PM +0100, Horst Kriegers wrote:<BR>> Hello,<BR>> <BR>> we have freshly migrated from 3.6.6 to 3.8.8 and the following custom scrip doesn't work.<BR>> <BR>> If I comment the line 12 "return 0 unless $cf->id;", I can see that the $cf->id and $cf->Name<BR>> are empty<BR>> <BR>> <BR>> <BR>> my $trans = $self->TransactionObj;<BR>> my $ticket = $self->TicketObj;<BR>> <BR>> $RT::Logger->debug('***************************************');<BR>> $RT::Logger->debug('>> trans->Type = ' . $trans->Type);<BR>> <BR>> if ($trans->Type eq 'CustomField') {<BR>> my $cf = new RT::CustomField($RT::SystemUser);<BR>> $cf->LoadByName(Queue => $ticket->QueueObj->id, Name => "Qualification securite");<BR><BR>You want to be capturing<BR><BR>my ($ok, $msg) = $cf->LoadByName<BR><BR>and warning out the $msg to see why it isn't loading<BR><BR>> ###return 0 unless $cf->id;<BR>> <BR>> $RT::Logger->debug('>> cf->id = ' . $cf->id);<BR>> $RT::Logger->debug('>> cf->Name = ' . $cf->Name);<BR>> $RT::Logger->debug('>> trans->Field = ' . $trans->Field);<BR>> $RT::Logger->debug('>> trans->NewValue = ' . $trans->NewValue);<BR>> $RT::Logger->debug('>> trans->OldValue = ' . $trans->OldValue);<BR>> $RT::Logger->debug('');<BR>> <BR>> if ($trans->Field == $cf->id && $trans->NewValue eq "Oui") {<BR>> $RT::Logger->debug($cf->Name . ' OUI.');<BR>> return 1;<BR>> } else {<BR>> $RT::Logger->debug($cf->Name . ' pas OUI.');<BR>> }<BR>> }<BR>> $RT::Logger->debug('***************************************');<BR>> <BR>> return 0;<BR>> <BR>> <BR>> <BR>> Logger result :<BR>> ------------------<BR>> [Fri Nov 5 13:07:14 2010] [debug]: *************************************** ((eval 5328):5)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: >> trans->Type = CustomField ((eval 5328):6)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: >> cf->id = ((eval 5328):14)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: >> cf->Name = ((eval 5328):15)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: >> trans->Field = 4 ((eval 5328):16)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: >> trans->NewValue = Non ((eval 5328):17)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: >> trans->OldValue = Oui ((eval 5328):18)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: ((eval 5328):19)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: pas OUI. ((eval 5328):25)<BR>> [Fri Nov 5 13:07:14 2010] [debug]: *************************************** ((eval 5328):28)<BR>> <BR>> <BR>> <BR>> Thanks in advance for your help.<BR>> Horst<BR>> <BR>> <BR>> PS<BR>> Sorry for my bad english...<BR>> <BR>> _______________________________________________________________________<BR>> <BR>> Le contenu de ce courriel est uniquement reserve `a la personne ou l'organisme `a qui il est<BR>> destine. Si vous n'etes pas le destinataire prevu, veuillez nous en informer au plus vite et<BR>> detruire le present courriel. Dans ce cas, il ne vous est pas permis de copier ce courriel, de<BR>> le distribuer ou de l'utiliser de quelque maniere que ce soit.<BR>> <BR>> _______________________________________________________________________<BR>> <BR>> The content of this e-mail is intended only and solely for the use of the named recipient or<BR>> organisation. If you are not the named recipient, please inform us immediately and delete the<BR>> present e-mail. In this case, you are nor allowed to copy, distribute or use this e-mail in<BR>> any way.<BR>> <BR>> _______________________________________________________________________<BR></DIV></TD></TR></TBODY></TABLE><BR>
<p>
<font face="Arial" size="2">
_______________________________________________________________________ </font>
</p>
<p align="left">
<font face="Arial" size="2">Le contenu de ce courriel est uniquement
réservé à la personne ou l'organisme à qui il est destiné. Si vous
n'êtes pas le destinataire prévu, veuillez nous en informer au plus vite
et détruire le présent courriel. Dans ce cas, il ne vous est pas permis
de copier ce courriel, de le distribuer ou de l'utiliser de quelque
manière que ce soit.
</font> </p>
<p align="left">
<font face="Arial" size="2">
_______________________________________________________________________ </font>
</p>
<p>
<font face="Arial" size="2">The content of this e-mail is intended only
and solely for the use of the named recipient or organisation. If you
are not the named recipient, please inform us immediately and delete the
present e-mail. In this case, you are nor allowed to copy, distribute or
use this e-mail in any way.
</font> </p>
<p>
<font face="Arial" size="2">
_______________________________________________________________________ </font>
</p>
</BODY></HTML>