[rt-users] Populating a Custom Field from an Action

Emmanuel Lacour elacour at easter-eggs.com
Fri Jun 14 11:07:55 EDT 2013


On Fri, Jun 14, 2013 at 02:29:56PM +0000, Daniel Tinoco-Silva wrote:
>    I have two queues (A and B). When a specific field is changed in Queue A,
>    an action is triggered, which creates a ticket in Queue B. Part of the
>    scrip is:
> 
>     
> 
>    $TicketObj->Create( Queue => $queue, Subject => $subject, Parents =>
>    $TicketNumber);
> 


An easier way is to make a scrip like this:



Condition: OnQueueChangeFromaAToB (write it yourself ;))
Action: CreateTicket (a built in action)
Template: CreateTicketInB

You need to create thist template like this:

===Create-Ticket: B0
Subject: {$subject}
Parent: {$Tickets{"TOP"}->Id}
Queue: B
CF-FIXME: FIXME-value
Content: blahblah
ENDOFCONTENT


you can add many other fields/customfields in this template!

see: http://www.bestpractical.com/rt/docs/4.0/RT/Action/CreateTickets.html#Acceptable-Fields


> 
>    $TicketObj->Create( Queue => $queue, Subject => $subject, Parents =>
>    $TicketNumber, CustomField-<n> => “Value”);
> 

should work also ( maybe qw(value) ).

> 
>    2)      How would you get the CustomField ID that would replace the letter
>    “n” in CustomField-<n>?
> 

my $CustomField = RT::CustomField->new( $session{CurrentUser} );
$CustomField->LoadByName ( Name => 'n', Queue => 'B' );
my $cf_id = $CustomField->id;


-- 
Easter-eggs                              Spécialiste GNU/Linux
44-46 rue de l'Ouest  -  75014 Paris  -  France -  Métro Gaité
Phone: +33 (0) 1 43 35 00 37    -   Fax: +33 (0) 1 43 35 00 76
mailto:elacour at easter-eggs.com  -   http://www.easter-eggs.com



More information about the rt-users mailing list