Scrip problem

RT fans,

I want to create couple of simple scrips using the built-in RT scrip
rules. Currently my RT notifies requestors on resolve (condition: On
Resolve, Action: Notify Requestors, Stage: TransactionCreate) which
works without problems. This scrip is global.

However, when I’m trying to notify requestors when they submit the
request I meet problems. The scrip settings are:

  • Condition: On Create
  • Action: Notify Requestors
  • Stage: TransactionCreate & TransactionBatch (see below)
  • Template setting refers to my own template.
  • No custom conditions or codes.

With TransactionCreate value the RT log creates following entries:

[Thu Jun 17 07:21:17 2004] [debug]: Converting ‘ISO-8859-1’ to 'utf-8’
for text/plain - Testi #3 ???
(/usr/local/rt3/lib/RT/I18N.pm:200)
[Thu Jun 17 07:21:17 2004] [info]:
rt-3.0.11-564-2426.2.15596302586114@helsinki.fi #564/2426 - Scrip 3
(/usr/local/rt3/lib/RT/Action/SendEmail.pm:92)
[Thu Jun 17 07:21:17 2004] [debug]: Converting ‘utf-8’ to 'iso-8859-1’
for text/plain -
=?ISO-8859-1?B?W2VkdS5oZWxzaW5raS5maSAjNTY0XSBUZXN0aSAjMyD25OXWxMU=?=
(/usr/local/rt3/lib/RT/I18N.pm:200)
[Thu Jun 17 07:21:17 2004] [info]:
rt-3.0.11-564-2426.2.15596302586114@helsinki.fi
No recipients found. Not sending.
(/usr/local/rt3/lib/RT/Action/SendEmail.pm:257)
[Thu Jun 17 07:21:17 2004] [error]: error: unexpected end of header

(/usr/local/rt3/lib/RT/Template_Overlay.pm:341)
[Thu Jun 17 07:21:17 2004] [info]: RT::Scrip=HASH(0x9897064): Couldn’t
prepare Notify Requestors (/usr/local/rt3/lib/RT/Scrip_Overlay.pm:346)
[Thu Jun 17 07:21:17 2004] [info]: Ticket 564 created in queue
’ktt-yleinen’ by mplattu@suomi24.fi
(/usr/local/rt3/lib/RT/Ticket_Overlay.pm:640)

With TransactionBatch the log looks like this:

[Thu Jun 17 07:23:04 2004] [debug]: Converting ‘ISO-8859-1’ to 'utf-8’
for text/plain - Testi #4 ???
(/usr/local/rt3/lib/RT/I18N.pm:200)
[Thu Jun 17 07:23:05 2004] [info]:
rt-3.0.11-565-2427.15.7015861779863@helsinki.fi #565/2427 - Scrip 3
(/usr/local/rt3/lib/RT/Action/SendEmail.pm:92)
[Thu Jun 17 07:23:05 2004] [debug]: Converting ‘utf-8’ to ‘iso-8859-1’
for text/plain -
=?ISO-8859-1?B?W2VkdS5oZWxzaW5raS5maSAjNTY1XSBUZXN0aSAjNCD25OXWxMU=?=
(/usr/local/rt3/lib/RT/I18N.pm:200)
[Thu Jun 17 07:23:05 2004] [info]:
rt-3.0.11-565-2427.15.7015861779863@helsinki.fi
No recipients found. Not sending.
(/usr/local/rt3/lib/RT/Action/SendEmail.pm:257)
[Thu Jun 17 07:23:05 2004] [info]: Ticket 565 created in queue
’ktt-yleinen’ by mplattu@suomi24.fi
(/usr/local/rt3/lib/RT/Ticket_Overlay.pm:640)

Another scrips would notify request owners on status/owner change. Here
I met similair problems.

Any suggestions? RT version is 3.0.11 with Apache 1.3.x, FastCGI, MySQL
4.0.x, Perl 5.8.3.

r. Matti L

Matti Lattu wrote:

RT fans,

I want to create couple of simple scrips using the built-in RT scrip
rules. Currently my RT notifies requestors on resolve (condition: On
Resolve, Action: Notify Requestors, Stage: TransactionCreate) which
works without problems. This scrip is global.

However, when I’m trying to notify requestors when they submit the
request I meet problems. The scrip settings are:

  • Condition: On Create
  • Action: Notify Requestors
  • Stage: TransactionCreate & TransactionBatch (see below)
  • Template setting refers to my own template.
  • No custom conditions or codes.

With TransactionCreate value the RT log creates following entries:
You need TransactionCreate.
If you want know more then read:
http://wiki.bestpractical.com/index.cgi?ScripExecOrder

Now TransactionBatch stage is mostly useless.

[Thu Jun 17 07:21:17 2004] [debug]: Converting ‘ISO-8859-1’ to 'utf-8’
for text/plain - Testi #3 ???
(/usr/local/rt3/lib/RT/I18N.pm:200)
[Thu Jun 17 07:21:17 2004] [info]:
rt-3.0.11-564-2426.2.15596302586114@helsinki.fi #564/2426 - Scrip 3
(/usr/local/rt3/lib/RT/Action/SendEmail.pm:92)
[Thu Jun 17 07:21:17 2004] [debug]: Converting ‘utf-8’ to 'iso-8859-1’
for text/plain -
=?ISO-8859-1?B?W2VkdS5oZWxzaW5raS5maSAjNTY0XSBUZXN0aSAjMyD25OXWxMU=?=
(/usr/local/rt3/lib/RT/I18N.pm:200)
[Thu Jun 17 07:21:17 2004] [info]:
rt-3.0.11-564-2426.2.15596302586114@helsinki.fi
No recipients found. Not sending.
http://wiki.bestpractical.com/index.cgi?FAQ
http://wiki.bestpractical.com/index.cgi?NoRecipFound

(/usr/local/rt3/lib/RT/Action/SendEmail.pm:257)
[Thu Jun 17 07:21:17 2004] [error]: error: unexpected end of header
http://wiki.bestpractical.com/index.cgi?Template

To all,

I am creating a new scrip with the condition "on status change" and 

additional condition code of:

return 0 ( $self->TicketObj->Status eq ‘open’ );
return 0 ( $self->TicketObj->Status eq ‘deleted’ );
return 0 ( $self->TicketObj->Status eq ‘resolved’ );

I have used this additional condition code before, but for only one 

status and it worked. In this situation, I do not want a status change
to “open”, or “deleted” or “resolved” to take action, as I have seperate
scrips for those conditions. Now, I am getting all three on this
condition. Help??

Kenn
LBNL

At Friday 3/23/2007 03:37 PM, Kenneth Crocker wrote:

To all,

    I am creating a new scrip with the condition "on status 

change" and additional condition code of:

return 0 ( $self->TicketObj->Status eq ‘open’ );
return 0 ( $self->TicketObj->Status eq ‘deleted’ );
return 0 ( $self->TicketObj->Status eq ‘resolved’ );

    I have used this additional condition code before, but for 

only one status and it worked. In this situation, I do not want a
status change to “open”, or “deleted” or “resolved” to take action,
as I have seperate scrips for those conditions. Now, I am getting
all three on this condition. Help??

Kenn
LBNL

Kenn,

You should use ‘User defined’ in the condition drop down, otherwise
your custom code will be ignored. Also, it looks like you need to
code ‘if’ in your lines of code.

Steve

At Friday 3/23/2007 03:37 PM, Kenneth Crocker wrote:

To all,

    I am creating a new scrip with the condition "on status 

change" and additional condition code of:

return 0 ( $self->TicketObj->Status eq ‘open’ );
return 0 ( $self->TicketObj->Status eq ‘deleted’ );
return 0 ( $self->TicketObj->Status eq ‘resolved’ );

    I have used this additional condition code before, but for 

only one status and it worked. In this situation, I do not want a
status change to “open”, or “deleted” or “resolved” to take action,
as I have seperate scrips for those conditions. Now, I am getting
all three on this condition. Help??

Kenn,

One more thing - your custom code should reproduce the ‘on status
change’ condition and examine the new value of the status field:

if ($self->TransactionObj->Type eq “Status” &&
$self->TransactionObj->NewValue eq “resolved”) etc

Steve

Stephen,

Sorry I took so long to respond. That did it and thanks.

Kenn
LBNL

Stephen Turner wrote: