[rt-users] capture status change to apply custom filed status

Asanka Gunasekera asanka_gunasekera at yahoo.co.uk
Thu Sep 20 02:31:03 EDT 2012


Hi Kenneth thanks for the reply and I found the Custom action code in RT wiki and below is the code hop this is the way to do it :)

    Description: On Open change Correspond Status 
    Condirion: On Create
    Action: User Defined
    Template: Global template: Blank
    stage: TransactionCreate

    Custom condition:

    my $txn = $self->TransactionObj;
    my $type = $txn->Type;
    return 0 unless $type eq "Status"
        || ( $type eq 'Set' && $txn->Field eq 'Status');

    return 0 unless $txn->OldValue eq "new";
    return 0 unless $txn->NewValue eq "open";
    return 1;


    Custom action preparation code:
    
    my ($success, $msg) = $self->TicketObj->AddCustomFieldValue(Field => 'Correspond Status', Value => 'Work in Progress');
    if (!$success) {
    $RT::Logger->error($msg);
    return 0;
    }
    return 1;


Thanks and Best Regards



________________________________
 From: Kenneth Crocker <kenn.crocker at gmail.com>
To: RT User List <rt-users at lists.bestpractical.com> 
Sent: Thursday, 20 September 2012, 11:38
Subject: Re: [rt-users] capture status change to apply custom filed status
 

Asanka,


That would probably be the transaction with a type of "Create". That's what triggers the ticket being created. If that is what you mean.

kenn


On Wed, Sep 19, 2012 at 3:25 AM, Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk> wrote:

this 
>
>
>
>
>________________________________
> From: Asanka Gunasekera <asanka_gunasekera at yahoo.co.uk>
>To: "rt-users at lists.bestpractical.com" <rt-users at lists.bestpractical.com> 
>Sent: Friday, 14 September 2012, 12:50
>Subject: capture status change to apply custom filed status
> 
>
>
>Hi, how can I capture the action of "opening" (not the open status) a new ticket to apply a custom filed value to "Work in progress"
>
>
>Thanks and regards
>
>
>
>
>--------
>Final RT training for 2012 in Atlanta, GA - October 23 & 24
>  http://bestpractical.com/training
>
>We're hiring! http://bestpractical.com/jobs
>
>


--------
Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120920/b23dc4f9/attachment.htm>


More information about the rt-users mailing list