Adding Custom Fields to Quick Create

Hi,

I’m working on adding custom fields to Quick Create on the main page of RT. I’ve been wading through code, but I’m having a hard time finding how RT saves the values of Custom Fields to tickets.

Can anyone shed some light or point me in the right direction?

Thanks!
Jon

Hi,

I’m working on adding custom fields to Quick Create on the main page
of RT. I’ve been wading through code, but I’m having a hard time
finding how RT saves the values of Custom Fields to tickets.

Can anyone shed some light or point me in the right direction?

share/html/Ticket/Create.html call share/html/Ticket/Display.html on
submit, after some processing, then Display.html do little processing
and pass args to RT::Interface::Web::CreateTicket which call
RT:Ticket::Create which create the ticket and add the customfields
values from args.

my ($status, $msg) = $self->_AddCustomFieldValue(
[…]

Hi,

I have found one solution, but it is not clear. I can find the ticket id in
message that is created.

I have added this code to /Elements/QuickCreate :

<&|/l&>Customer:

and this part to index.html :

if ( $ARGS{‘Customer’} )
{
my @ids = split(’ ', $msg); # split message with new ticket
info
my $ticketid = $ids[1]; # get id of newly created
ticket (always on second position)
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $cf_name = “Customer”; # Name of Custom Field
$cf_obj->LoadByName( Name => $cf_name );
my $Ticket = RT::Ticket->new($session{‘CurrentUser’});
$Ticket->LoadById($ticketid);
my ($status, $msg2) = $Ticket->_AddCustomFieldValue(
Field => $cf_name,
Value => $ARGS{‘Customer’}
);
push @results, $msg2;

        }        

I hope this can help or somebody can show me different (clear) way how to do
it.

Thanks,

Z.

Emmanuel Lacour wrote:

Hi,

I’m working on adding custom fields to Quick Create on the main page
of RT. I’ve been wading through code, but I’m having a hard time
finding how RT saves the values of Custom Fields to tickets.

Can anyone shed some light or point me in the right direction?

share/html/Ticket/Create.html call share/html/Ticket/Display.html on
submit, after some processing, then Display.html do little processing
and pass args to RT::Interface::Web::CreateTicket which call
RT:Ticket::Create which create the ticket and add the customfields
values from args.

my ($status, $msg) = $self->_AddCustomFieldValue(
[…]


List info:
The rt-devel Archives

View this message in context: http://www.nabble.com/Adding-Custom-Fields-to-Quick-Create-tp18220450p19530792.html

Hi,

I’m working on adding custom fields to Quick Create on the main page of RT. I’ve been wading through code, but I’m having a hard time finding how RT saves the values of Custom Fields to tickets.

Can anyone shed some light or point me in the right direction?

Thanks!
Jon