[rt-users] Open Ticket On Resolve Of Dependants?

Christian Loos cloos at netcologne.de
Wed Feb 6 03:53:21 EST 2013

Hi Kevin,

this scrip open the parent ticket if all dependent are closed:

my $deps = $self->TicketObj->DependedOnBy;
while( my $link = $deps->Next ) {
    next unless $link->BaseURI->IsLocal;
    my $dep = $link->BaseObj;
    next if $dep->QueueObj->IsInactiveStatus($dep->Status);
    $dep->SetStatus('open') unless $dep->HasUnresolvedDependencies;
return 1;

Note that you have to change your scrip condition to "On Close".

I don't understand the part with the ticket subject. Maybe you can
figure it out by yourself with my suggestion or you can explain it a
little bit more what you want to do.


Am 05.02.2013 17:03, schrieb Kevin Comer:
> Hello,
> I am new to Perl and RT Scrips, and I need to set up a scrip that will
> change the parent ticket from new to open when all dependent tickets
> have been resolved, or have it perform only on the Subject of one
> Specific Ticket.
> I found this script below and it works on the first ticket resolved. How
> can I modify this scrip to either wait till all dependents are resolved
> or resolved on a specific subject?
> I have tried this to get it to work on the subject, but to no
> avail.      next unless( $l->BaseObj->Subject eq
> 'Change-Coordinator-Approval');
> How can I find or figure out what objects are available for the
> different sections of a ticket? etc.
> Condition: On Status Change
>      Action: User Defined
>  Template: Global Template Blank
> Customer action: 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;
> Any thoughts or ideas?
> Thanks in advance
> The information transmitted in this email is intended only for the
> person or entity to which it is addressed and may contain confidential
> and/or privileged material.  Any review, retransmission, dissemination
> or other use of, or taking of any action in reliance upon this
> information by persons or entities other than the intended recipient is
> prohibited.  If you received this email in error, please contact the
> sender and delete the email from your computer.

More information about the rt-users mailing list