Problem when resolving ticket (scripts)

All,

I’m having a problem when resolving my tickets. It executes my scripts, but fails before they finish… I get the following in syslog…

Dec 23 09:14:09 src@cucontrol4 RT: About to think about scrips for transaction12513
Dec 23 09:14:09 src@cucontrol4 RT: About to prepare scrips for transaction12513
Dec 23 09:14:09 src@cucontrol4 RT: Found 5 scrips
Dec 23 09:14:09 src@cucontrol4 RT: error: unexpected end of header (/usr/lib/RT/Template_Overlay.pm:341)
Dec 23 09:14:10 src@cucontrol4 RT: error: unexpected end of header (/usr/lib/RT/Template_Overlay.pm:341)
Dec 23 09:14:10 src@cucontrol4 RT: About to commit scrips for transaction12513

I have 4 scrips (above says RT sees 5 though??) and they are as follows (in this order on the global scrips screen…

#On Resolve Notify Requestors with template Resolved (not working)
#On Resolve Notify AdminCcs with template Admin Resolved (working)
#On Resolve User Defined with template Blank (working)
#On Resolve Notify Ccs with template Resolved (not working)

The user defined section of “On Resolve User Defined with template Blank” is the same as I use for another scrip “On Correspond User Defined with template Blank”. Basically it takes the ticket if someone resolves/corresponds but has not “taken” the ticket. All of the correspondance scripts work correctly, so I don’t believe this specific scrip is “clogging” It up.

Below are the properties of the user defined scrip… TIA and happy holidays.

custom condition: 
	[blank]
custom action prep: 
	return 1;
custom action cleanup: 
	my $Actor = $self->TransactionObj->Creator;
	return 1 if $Actor == $RT::SystemUser->id;
	return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
	$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #". $Actor );
	my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
        unless( $status ) {
   	 $RT::Logger->warning( "Impossible d'attribuer le ticket à $Actor: $msg" );
	 return undef;
	}
	return 1;

Daniel Jimenez
MemberSource Credit Union
Information Systems Analyst
djimenez@membersourcecu.org

Yep, you were correct!!! Thanks!From: Rick Russell [mailto:rickr@rice.edu]
Sent: Friday, December 23, 2005 9:55 AM
To: Daniel Jimenez
Subject: Re: [rt-users] Problem when resolving ticket (scripts)

You’re looking in the wrong place. The scrip is probably fine; it sounds like you have an error in your Resolved template. That’s why the other scrips execute fine but the Resolved scrip fails.

Rick R.

Daniel Jimenez wrote:

All,

I’m having a problem when resolving my tickets. It executes my scripts, but fails before they finish… I get the following in syslog…

Dec 23 09:14:09 src@cucontrol4 RT: About to think about scrips for
transaction12513 Dec 23 09:14:09 src@cucontrol4 RT: About to prepare
scrips for transaction12513 Dec 23 09:14:09 src@cucontrol4 RT: Found 5 scrips
Dec 23 09:14:09 src@cucontrol4 RT: error: unexpected end of header (/usr/lib/RT/Template_Overlay.pm:341)
Dec 23 09:14:10 src@cucontrol4 RT: error: unexpected end of header (/usr/lib/RT/Template_Overlay.pm:341)
Dec 23 09:14:10 src@cucontrol4 RT: About to commit scrips for
transaction12513

I have 4 scrips (above says RT sees 5 though??) and they are as follows (in this order on the global scrips screen…

#On Resolve Notify Requestors with template Resolved (not working) #On
Resolve Notify AdminCcs with template Admin Resolved (working) #On
Resolve User Defined with template Blank (working) #On Resolve Notify
Ccs with template Resolved (not working)

The user defined section of “On Resolve User Defined with template Blank” is the same as I use for another scrip “On Correspond User Defined with template Blank”. Basically it takes the ticket if someone resolves/corresponds but has not “taken” the ticket. All of the correspondance scripts work correctly, so I don’t believe this specific scrip is “clogging” It up.

Below are the properties of the user defined scrip… TIA and happy holidays.

custom condition: 
  [blank]
custom action prep: 
  return 1;
custom action cleanup: 
  my $Actor = $self->TransactionObj->Creator;
  return 1 if $Actor == $RT::SystemUser->id;
  return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
  $RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #". $Actor );
  my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
        unless( $status ) {
 	 $RT::Logger->warning( "Impossible d'attribuer le ticket à $Actor: $msg" );
   return undef;
  }
  return 1;

Daniel Jimenez
MemberSource Credit Union
Information Systems Analyst
djimenez@membersourcecu.org


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Rick Russell
For computer help, call xHELP (x4357 or 713-348-4357) OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu 761D 1C20 6428 580F BD98 F5E5 5C8C 56CA C7CB B669
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267 Fax: 713.348.6099