[rt-users] first time writing scrips, and having problems with auto-resolving and setting transation's timetaken
hubert lubaczewski
hubert.lubaczewski at eo.pl
Wed Sep 29 11:58:06 EDT 2004
hi
first of all - i'm using rt 3.0.6. (will be upgradeing very soon, but
right now it's all i have).
i wanted to write a scrip which will allow me to resolve tickets and set
"timetaken" per transaction in mails i send to rt (which later are added
as correspondence to tickets).
so i wrote this scrip:
#v+
my $sContent = $self->TransactionObj->ContentObj->Content;
my $sCreator = $self->TransactionObj->CreatorObj->EmailAddress;
return 1 unless $sCreator =~ /^[a-z\.]+\@OUR_DOMAIN$/;
$sContent =~ s/\s*$//; # this makes $sContent
$sContent =~ s/^.*\n//s; # Contain only last non-empty line
return 1 unless $sContent =~ s/^xx:\s+//;
if ($sContent =~ s/(^|\s+)w:(\d+)($|\s+)/ /) {
my $tic = $self->TicketObj;
my @a = $tic->SetTimeWorked( $tic->TimeWorked + $2 );
}
if ($sContent =~ s/(^|\s+)s:(resolved|stalled|rejected)($|\s+)/ /) {
$self->TicketObj->SetStatus($2);
}
return 1;
#v-
looks simple.
1st.
i would like to set timetaken per transation, but when i tried:
$self->TransactionObj->SetTimeTaken($2);
i got error: Immutable Field.
is there anything i can do without modifiyng .pm's (i know about
writing _Local.pm's, but i dont like the idea).
2nd (and more important).
When i do SetStatus this way - it works, BUT - then goes global scrip:
"On Correspond Open Tickets with template Blank"
which is (as far as i know) standard in rt.
i like this global scrip so i'm not goging to turn this off, but maybe
there is a way to temporary disable it when i setstatus otherwise?
i really hope some of you can help me, and sorry for my english.
depesz
--
hubert lubaczewski
Network Operations Center
Eo Networks Sp. z o.o.
More information about the rt-users
mailing list