Guidance on Form usage that creates correspondence + comment

Hi there,

I’m pretty new to RT, still going through the documentation. I’m looking for some guidance on how to achieve an idea (by guidance I mean, where to look at to guide my learning effort). Don’t know Perl (yet) but I’m a quick learner (I hope).

(“client” below is our client for whom we receive government letters on their behalf).

I have:

  • a Queue to process incoming notices (like letters from government, etc) with some Custom Fields.
  • also an Article Class to hold articles with internal guidance on how to dispatch those (one article per type of notice). Using Custom Fields on the article I have
    • (Content) some introductory text on “what this is about” to send to our client
    • Instructions on how to internally assign the item
    • Instructions on how to proceed (what the assignee shall do first)

Now, what I would like to do is:

  • Create a new Ticket, (we’d open one for each incoming notice)
    • fill in the notice details.
      • Requestor would be our client e-mail here.
    • select the Article that explains that notice type
    • the notice PDF file attached to a field
  • RT would now:
    • Fill the ticket subject using data from the fields
      • “Notice {NoticeTitleField} received on {NoticeReceivedDate} for {ClientName}”
    • Send, as correspondence to the requestor, the Content of the Article and the PDF notice from the custom field.
    • Send, as a comment, to the assignee, the “how to proceed” field of the Article and the PDF notice

So, I think I know:

  • I need to work with Custom Fields (done)
  • I need the FormTools Extension to do my Ticket Creation form

I do not know, and I’d appreciate some guidance on how to:

  • After the form, but before the “On Create Autoreply **” scrips,
    • I need to fill the ticket Subject, with some string formatting code
    • I need to fill the ticket Content using data from the Article selected in the Form
  • “On Create Autoreply To Requestors” should then be just fine for this,
  • I would need to duplicate “On Create Notify Owner and AdminCcs” to use a template that includes the “how to proceed” instructions from the article – don’t know how to go about the template part.

Again, just looking for some pointers on where to look at; on how to properly tackle this idea (the above is based on my current, albeit limited, knowledge of RT)

Thanks,

Marc

To create the custom subject for the ticket, you can probably use another scrip that you set higher in the list than the auto reply one. This scrip would fire “On Create” and would pick out the three custom fields you want that you’ve already created in the ticket and then use the
RT::Ticket->SetSubject() method to change the ticket subject.

Alternatively you could make a new custom auto reply scrip that does this Subject hacking and then sends the auto reply template in one go. That could be handy, especially if your template needs to pull information from articles, etc using the Perl API. RT gives you two options for templates: simple text templates with a bit of basic (fixed) variable interpolation, and “Perl templates”. Using Perl in templates you can embed arbitrary Perl code, including calls to the full RT Perl API, so you can do lots of funky processing to build replies. Take a look at the information here for an explanation of Perl templates.

1 Like