[rt-users] Linking a Transaction CF value to a Ticket CF value

Kevin Falcone falcone at bestpractical.com
Wed Jul 3 11:58:14 EDT 2013

On Wed, Jul 03, 2013 at 07:00:26AM -0700, scott.dalzell wrote:
> I currently have 2 customfields assosated with my tickets. Both will be used
> to highlight a ticket to our support team when set to 'Alert'.
> Currently the CF on the ticket is used to updates the required tables and
> notify support etc but having a CF on the Transaction would make it easyer
> for the user to Alert support and give a description of the issue as many
> times the user has forgoten to do this 

I'm glad I noticed you had started a new thread, so I didn't reply to
your Load questions on the previous thread.

> Ticket CF - 'Alert_Support'
> Trans CF - 'Alert_Support_T'

Is the Create part working?

> #Check CustomField on Create ticket
>  if ( $type eq 'Create' ) {
>      return 0 unless $trans->FirstCustomFieldValue('Alert_Support_T') eq
> 'Alert';
>  } 

For this part, add debugging:

> #check Customfield on ticket update
> elsif ( $type eq 'CustomField' ) {
>      # CF can be changed later
>      my $cf = RT::CustomField->new( $self->CurrentUser );
>      $cf->Load( $trans->Field );

You should always check Load
my ($id, $msg) = $cf->Load("Foo");
unless ($id) {
    RT->Logger->error("Unable to load Foo: $msg";
    return 0;

Use similar RT->Logger calls below to find out where your condition is


>      return 0 unless $cf->Name eq 'Alert_Support_T';
>      return 0 unless $trans->NewValue eq 'Alert';
>  } else {
>      return 0;
>  }
>  return 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130703/f940910d/attachment.sig>

More information about the rt-users mailing list