[rt-users] Desperate, problem with script

Daniel Garcia Mejia dgarcia at cesca.cat
Thu Dec 29 11:06:40 EST 2011


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 at cesca.cat
.......................................................................




More information about the rt-users mailing list