Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Adding Custom Fields to Quick Create

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


jjeppson at mosscodilis

Jul 1, 2008, 9:04 AM

Post #1 of 3 (361 views)
Permalink
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

_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


elacour at easter-eggs

Jul 1, 2008, 10:09 AM

Post #2 of 3 (346 views)
Permalink
Re: Adding Custom Fields to Quick Create [In reply to]

On Tue, Jul 01, 2008 at 10:04:04AM -0600, Jonathan Jeppson 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: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


zodal at centrum

Sep 17, 2008, 5:16 AM

Post #3 of 3 (224 views)
Permalink
Re: Adding Custom Fields to Quick Create [In reply to]

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 :

<tr class="input-row">
<td class="label"><&|/l&>Customer</&>:</td>
<td colspan="3" class="value"><input type="text" size="50" name="Customer"
/></td>
</tr>

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:
>
> On Tue, Jul 01, 2008 at 10:04:04AM -0600, Jonathan Jeppson 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:
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
>

--
View this message in context: http://www.nabble.com/Adding-Custom-Fields-to-Quick-Create-tp18220450p19530792.html
Sent from the Request Tracker - Dev mailing list archive at Nabble.com.

_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.