[rt-users] setting the DueData upon ticket creation

Ruslan U. Zakirov Ruslan.Zakirov at miet.ru
Fri Jul 15 11:32:15 EDT 2005


Michael Bochynski wrote:
> Hi All,
> 
> I struggle with a (small) issue. I bet there is a simple solution for
> this, however... 
> 
> Here's what I do
> 
> 1. I send an email, which has month:MM, day:DD, year:YYYY, hour:HH,
> min:NN fields in the body
> 2. I want to extract those fields and create ticket's DueDate with those
> values.
> 
> I was looking at http://wiki.bestpractical.com/index.cgi?
> SetTicketPropertiesViaMail
> 
> However somehow I cannot set the DueDate.
> 
> In my scrip, instead of
> 
> if( $content =~ m/^\QSet-Owner:\E\s*(\S+)\s*$/m ) {
> 
>       $self->TicketObj->SetOwner( $1 );
> }
> 
> I use 
> 
> if( $content =~ m/^\Qmonth:\E\s*(\S+)\s*$/m ) {
> 
>       my $month = $1;
> }
If you define variable with 'my' then it would be local to the block
it's defined in.
So try something like:
<<<
my ($month, $day);
if( $content =~ m/^\Qmonth:\E\s*(\S+)\s*$/im ) {
	$month = $1;
}
if( $content =~ m/^\Qday:\E\s*(\S+)\s*$/im ) {
	$month = $1;
}
...
my $date = "$month-$day";
...
>>>


> 
> and so on for every field. 
> 
> However, I cannot set the DueDate later on. I tried with
> $self->TicketObj->SetDue($date)
don't forget ; at the end of lines.

also I'm sure RT log has entries that scrip action has errors.
Please, analize logs.

> 
> however I have problems with creating proper $date field.
> 
> Any ideas?
> 
> Michael
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> 




More information about the rt-users mailing list