Addition condition checking for scrips

How would I add additional conditions to already existing conditions for
scrips?

I want to have various templates for emails based on various conditions. I
would like to be able to create a scrip for a “On Create” condition and have
one or more other conditions. One of the scrips will fire and be associated
with the appropriate template. Only way I can see is to create custom
condition checking code that would replace the “On Create” condition and
contain my additional conditions as well.

Or is there a way I could dynamically change the associated template during
runtime, based on values or state of the ticket.

Thanks
Dave

This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.

Ce courrier �lectronique est confidentiel et prot�g�. L’exp�diteur ne renonce pas aux droits et obligations qui s’y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu’il contient par une personne autre que le (les) destinataire(s) d�sign�(s) est interdite. Si vous recevez ce courrier �lectronique par erreur, veuillez m’en aviser imm�diatement, par retour de courrier �lectronique ou par un autre moyen.

How would I add additional conditions to already existing conditions for
scrips?

I want to have various templates for emails based on various conditions. I
would like to be able to create a scrip for a “On Create” condition and have
one or more other conditions. One of the scrips will fire and be associated
with the appropriate template. Only way I can see is to create custom
condition checking code that would replace the “On Create” condition and
contain my additional conditions as well.

Or is there a way I could dynamically change the associated template during
runtime, based on values or state of the ticket.

3 options, if I understand correctly.

  1. An RT “template” is fed to HTML::Template. So in reality,
    a template can accomodate any amount of perl inside braces.
    You can write a dynamic template that checks conditions
    and outputs accordingly.

  2. Create a user defined scrip for each condition.
    In each such scrip, you fully code the condition
    on the gui when you make the scrip. The codition will check
    for create status, and whatever else you need. I think
    this is the option you mentioned originally.

  3. Create one or more custom ScripConditions (as opposed to Scrips).
    This invovles writing a little code to be kept with the RT
    libraries, and inserting rows into the ScripConditions
    table. Then you can use these new conditions in new scrips,
    using the dropdown box rather than adding custom code to
    the scrip itself. This is a bit more complicated;
    however when you insert into the table ScripConditions,
    you must specify which code to execute (the new library file
    you wrote), what argument to pass it (if any), and what
    transaction state applies. The transaction state is
    something like create, correspond, any, … The point being,
    the test for “create” is very simply handled right in
    the sql table, and your code can check for the other
    things of interest to you.

    bobg

  1. An RT “template” is fed to HTML::Template. So in reality,
    a template can accomodate any amount of perl inside braces.
    You can write a dynamic template that checks conditions
    and outputs accordingly.

Just so no one is confused, its a Text::Template, not HTML::Template.

Michael
Michael S. Liebman m-liebman@northwestern.edu
http://msl521.freeshell.org/
“I have vision and the rest of the world wears bifocals.”
-Paul Newman in “Butch Cassidy & the Sundance Kid”