Desperate, problem with script

Hi,

Surfing the Internet I found this code:

The code is as follows:

Description: open tickets which depends on resolved
Condition: On Status Change
Custom Condition:
Action: User defined
Custom action preparation code: return 1;
Custom action cleanup code:
return 1 if ($self->TransactionObj->NewValue !~
/^(?:resolved|deleted|rejected)$/);
my $DepOnBy = $self->TicketObj->DependedOnBy;
while( my $l = $DepOnBy->Next ) {
next unless( $l->BaseURI->IsLocal );
next unless( $l->BaseObj->Status =~ /^(?:new|open|stalled)$/ );

 # here you can add any action
 # see also example below
 $l->BaseObj->SetStatus('open');

}
$DepOnBy = undef;
return 1;
Template: Global template: Blank

I’ve tested and works correctly.
But I tried for tickets Approvals dependent and does not work.

I tried putting the type of ticket you had to look at, specifically in
the line:

my $DepOnBy = $self->TicketObj->DependedOnBy(Type => ‘approval’);

But still doesn’t work and I can’t make it ‘Open’ a ticket when all
Approvals of ticket are ‘Resolved’.

Can anybody help me? I’m desperate

THANKS!!!

Best regards

Daniel


/ / Daniel Garc�a Mej�a
C E / S / C A Portals i Repositoris
/_/ Centre de Serveis Cient�fics i Acad�mics de Catalunya

Gran Capit�, 2-4 (Edifici Nexus) - 08034 Barcelona
T. (NULL) - F. 93 205 6979 - dgarcia@cesca.cat