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

Hi,
On RT at a glance there is the “Quick search” pane, which lists the
queues with number of open, new and stalled tickets. Clicking on one of
those numbers shows the list of tickets in the ques with that status. In
that listing I would like to add a column globally. Of course I can edit
that search, but I can only store it as a new search. Is there a way to
update those searches?
Many thanks
Felix

On RT at a glance there is the “Quick search” pane, which lists the
queues with number of open, new and stalled tickets. Clicking on one of
those numbers shows the list of tickets in the ques with that status. In
that listing I would like to add a column globally. Of course I can edit
that search, but I can only store it as a new search. Is there a way to
update those searches?

Those searches use the default search format:
http://bestpractical.com/rt/docs/latest/RT_Config.html#DefaultSearchResultFormat

The default values are in your RT_Config.pm and you can override them
in RT_SiteConfig.pm to include your CF.

-kevin

thisFrom: Asanka Gunasekera asanka_gunasekera@yahoo.co.uk
To: “rt-users@lists.bestpractical.comrt-users@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

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.

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

this


From: Asanka Gunasekera asanka_gunasekera@yahoo.co.uk
To:rt-users@lists.bestpractical.comrt-users@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! Careers — Best Practical Solutions

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 :slight_smile:

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 RegardsFrom: Kenneth Crocker kenn.crocker@gmail.com
To: RT User List rt-users@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

this


From: Asanka Gunasekera asanka_gunasekera@yahoo.co.uk
To: “rt-users@lists.bestpractical.comrt-users@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! Careers — Best Practical Solutions

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

We’re hiring! Careers — Best Practical Solutions

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 condition makes no sense since you’re using the built-in On
Create condition. It’s not getting run, and you should remove it.

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;

All actions should be in the “Custom action cleanup code”. Prepare is
used to check if the action can run, and in your case it should simply
return 1. Putting record updates in Prepare means you might end up with
duplicate transactions.

Hi All, hope this will help some one :slight_smile: I found this post (RT wick) and gave me exactly what I was looking for

http://requesttracker.wikia.com/wiki/CustomConditionSnippets#on_Status_Change_from_.22new.22_to_.22open.22

Description: Asa - On Open change Correpond 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 RegardsFrom: Asanka Gunasekera asanka_gunasekera@yahoo.co.uk
To: “rt-users@lists.bestpractical.comrt-users@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