[rt-users] Collecting info from child tickets (scrip action)

Thomas Sibley trs at bestpractical.com
Mon Apr 29 18:23:24 EDT 2013


Links have a target and a base (a destination and source), and therefore
can be expressed in two directions.  RefersTo is the inverse of
ReferredToBy, and vice versa.  In the database, links are stored in as
canonical types and directionality is determined by which object is the
target and which is the base.  In the API, directionality and
base/target combinations are exposed through the methods you found.

You're ending up with the same ticket you started with because you're
looking at the wrong end of the link.

On 04/29/2013 08:17 AM, Tyler Harding wrote:
> I asked about this once and didn't get a response, 2nd (and final) try…
> 
> I'm trying to write a script that pokes around in child tickets. My
> abridged version of it:
> 
> my $Children = $self->TicketObj->Members();
> while( my $childTicket = $Children->Next ) {
> my $childId = $childTicket->TargetObj->id;
> # Do some other stuff here....
> }
> return 1;
> 
> However the above only gives me information about the ticket I started
> in (i.e. $self->TicketObj). For whatever reason, the following work as
> anticipated:
> 
> $self->TicketObj->MemberOf();
> $self->TicketObj->DependsOn();
> $self->TicketObj->RefersTo();
> 
> And these simply cough up the same ticket I started with:
> 
> $self->TicketObj->Members();
> $self->TicketObj->DependedOnBy();
> $self->TicketObj->ReferredToBy();
> 
> Any ideas? We're running v4.0.4.
> 
> Thank you,
> 
> -Tyler




More information about the rt-users mailing list