Hi Jonathan,

After the code for creation of dependent ticket,

> my $new_tkt = RT::Ticket->new($RT::SystemUser); my ($id, $msg) = 
> $new_tkt->Create(
>      Queue => "Data Analysis",
>      Subject => $tkt->Subject,
>     Status => 'new',
>     Requestor => $requestors,
>     DependedOnBy => $tkt->Id);

Try to add something like this one:

my $CFName = "Your CF NAME goes here";
my $ValueToAssign = "Your VALUE goes here";
my $RecTransaction = 1;
my $QueueObj = $new_tkt->QueueObj;
my $CFObj = RT::CustomField->new( $QueueObj->CurrentUser );
$CFObj->LoadByName( Name => $CFName);
my( $id, $msg ) = $new_tkt->AddCustomFieldValue(
                   Field => $CFObj->id,
                   Value =>  $ValueToAssign,
                   RecordTransaction => $RecTransaction );

Hope it helps, Sorry but I have no time to test it...
Gabriele

------------------------------

Message: 3
Date: Tue, 8 Dec 2009 14:46:49 -0800 (PST)
From: Jonathan Rummel <jrum...@imapp.com>
Subject: Re: [rt-users] Auto-creating a 'dependant' ticket On
        Transaction
To: rt-users@lists.bestpractical.com
Message-ID: <26702202.p...@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii


Gabriele,

It works perfectly!  Thanks!  That's just what I needed!

Do you have any idea how to refer to a Custom Field within the newly
created ticket?  Ex:

$new_tkt->Create(
     Queue => "Data Analysis",
     Subject => $tkt->Subject,
    Status => 'new',
    CUSTOM FIELD => "VALUE",  <== (what's the proper syntax here for
setting the new ticket's cf value?)
    Requestor => $requestors,
    DependedOnBy => $tkt->Id);

Thanks again!
Jonathan

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to