[rt-users] capture status change to apply custom filed status
Asanka Gunasekera
asanka_gunasekera at yahoo.co.uk
Wed Nov 14 00:08:58 EST 2012
Hi All, hope this will help some one :) 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 Regards
________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20121114/44919453/attachment.htm>
More information about the rt-users
mailing list