Hello, appreciate if can get advice. I would like to change the ticket’s Status to ‘taken’ from new after i ‘take’ the ticket.
My Script below,
Condition: On Owner change
Action: User Defined
Template: Blank
User Defined condition and results
Custom condition: return 1;
Custom action preparation code: return 1;
Custom action commit code:
$RT::Logger->info(’"-----Debug---- TransactionObj Type = '. $self->TransactionObj->Type);
if ($self->TransactionObj->Type eq ‘Take’ ) {
$self->TicketObj->SetStatus(‘taken’);
}
return 1;
Below part of the log file showing:
[52014] [Mon Mar 21 04:55:19 2022] [info]: "-----Debug---- TransactionObj Type = Set ((eval 1573):1)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: About to prepare scrips for transaction #191087 (/opt/rt5/sbin/…/lib/RT/Transaction.pm:189)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: Found 2 scrips for TransactionCreate stage with applicable type(s) SetWatcher for txn #191087 on ticket #20504 (/opt/rt5/sbin/…/lib/RT/Scrips.pm:477)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: Skipping Scrip #31 because it isn’t applicable (/opt/rt5/sbin/…/lib/RT/Scrips.pm:337)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: About to commit scrips for transaction #191087 (/opt/rt5/sbin/…/lib/RT/Transaction.pm:212)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: Committing scrip #24 on txn #191087 of ticket #20504 (/opt/rt5/sbin/…/lib/RT/Scrips.pm:290)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: Found 0 scrips for TransactionBatch stage with applicable type(s) Set,SetWatcher for txn #191086 on ticket #20504 (/opt/rt5/sbin/…/lib/RT/Scrips.pm:477)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: RT::Date used Time::ParseDate to make ‘2022-02-23 12:00:00’ 1645588800 (/opt/rt5/sbin/…/lib/RT/Date.pm:274)
[52014] [Mon Mar 21 04:55:19 2022] [debug]: RT::Date used Time::ParseDate to make ‘2022-02-23 10:00:00’ 1645581600 (/opt/rt5/sbin/…/lib/RT/Date.pm:274)
[52014] [Mon Mar 21 04:55:21 2022] [debug]: Rendering attachment #68320 of ‘text/html’ type (/opt/rt5/share/html/Elements/ShowTransactionAttachments:208)
Thank you.