[rt-users] Help with Templates

Alex Peters alex at peters.net
Tue Dec 16 18:28:55 EST 2014


You're getting an RT::Links instance, which is an iterator.  I've used
something like this with success:

Related ticket IDs: {
  my @refers_to_ids;
  my $refers_to = $Ticket->RefersTo;
  while (my $link = $refers_to->Next) {
    next unless $link->BaseURI->IsLocal; # skip over non-ticket links
    push @refers_to_ids, $link->BaseObj->id;
  }
  return join(q{, }, map { "#$_" } sort @refers_to_ids;
}

On 17 December 2014 at 07:51, Thomas Westlund <thomas at westlund.no> wrote:
>
>  Hi,
>
> I want to display the ID of related Tickets in my template
>
> I tried using this  {$Ticket->RefersTo}
>
> But that just returns RT::Links=HASH(0x7f6dc46f7d20)
>
> How can I expand this to the ID of the related object?
>
> Regards
>
> --
>
> Thomas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20141217/eff766a5/attachment.htm>


More information about the rt-users mailing list