On Wed, Feb 05, 2014 at 03:42:38PM +0000, Simon Wilcox wrote:
> What we'd like to do is auto-link tickets together whenever they're
> mentioned in a comment or response. The regex to extract the ticket
> numbers from the body of the message I have and I think I know how
> to create a link[1] but I can't figure out the recommended way to
> incorporate that code into a scrip.
> 
> I'm probably missing something in the docs but please could you
> advise how to go about putting this together ?
> 
> [1] based on the code in RT/Ticket.pm it will be something like
> $self->AddLink( Type   => 'RefersTo', Target => $found_id );

In the custom action commit code you can get the current ticket with:
$self->TicketObj and then it's just a matter of gluing on the
appropriate AddLink call as you've found above.

Keep in mind directionality of the link, which will determine if you
want Target or Base (RefersTo vs ReferredToBy).
In 4.2, relevant docs are on RT::Record::_AddLink and
http://bestpractical.com/docs/rt/latest/RT/Record/Role/Links.html#AddLink1

-kevin

Attachment: pgpw8Mu43JCtl.pgp
Description: PGP signature

Reply via email to