Get QueueName in External CustomField

Hi,

I am trying to create a CustomField with data obtained from a database.
I need to pass the current queue name as a where clause into the
External Source script.

A little background:

  • Multiple customers, each customer has their own queue.
  • Each customer has a a different set of products which they are
    supported for.

The product list will be stored on a database referenced with the queue
name for that particular customer. When you try and create a ticket in
one of these queues, I want to populate the data in the CustomField by
passing the queue name to the external source script.

This is what I have tried so far:

sub ExternalValues {
my $self = shift;

 my $queue = $self->TicketObj->QueueObj;

[…]

}

When I run the above, I get the following message:

“Can’t locate object method “TicketObj” via package…”

Any help here would be appreciated.

Kind Regards,

Pritpal

I am trying to create a CustomField with data obtained from a database.
I need to pass the current queue name as a where clause into the
External Source script.

sub ExternalValues {
my $self = shift;

my $queue = $self->TicketObj->QueueObj;

[…]

}

When I run the above, I get the following message:

“Can’t locate object method “TicketObj” via package…”

This is because $self isa RT::CustomFieldValues::External,
RT::CustomFIeldValues, RT::SearchBuilder, none of which have any
ticket data.

Unfortunately, I’m not aware of any way to currently get the
information you want inside ExternalValues. Keep in mind that during
Ticket Creation, you wouldn’t even have a ->TicketObj to use (since it
hasn’t been created yet).

Patches that pass more context through to ExternalValues would be
welcome, but will likely be complex.

-kevin