[rt-users] Question about using a web form to create a request.

Eric Goodman ericg at cats.ucsc.edu
Wed Feb 7 12:52:25 EST 2001


My understanding is that the best way is have the web invoke the 
command line rt commands, as K. Hamer did in OncallForm.cgi (I think 
that's in the contrib area). Trying to do it through rt-mailgate 
seems more difficult, as you would need an agent intercepting RT mail 
and would have to filter out the tickets it didn't care about.

In particular, Ken uses the rt -create command. This is an 
interactive command that runs something like this:

$ ./rt -create
Welcome to Request Tracker 1.0.2
Place Request in queue:[testing]
Place Request in area:
Give request to:[ericg]
Requestor(s):[ericg at cats.ucsc.edu]
Subject:[test CLI]  
Starting Priority:
Final Priority:
Date due (MM/DD/YY):[2/10/01]
Please enter a detailed description of this request, terminated
by a line containing only a period:
[This is a test ticket creation.]
[.]

The brackets are not actually typed of course, they are just to 
indicate that I entered that data. The above mentioned CGI just makes 
a file containing the appropriate responses, and then invokes "rt 
-create < responseFile". He then filters the response with:

       if ( /^Request #(\d+) created/ ) {
         # A request was created
         $s_reqnum = $1;
       }

To get the request number and resolve the ticket if appropriate. 
That's seems like your best bet.

--- Eric

>Here's another idea:
>
>- have your web-form use the rt-mailgate command with "extended-syntax"
>   and the "-t" flag (which causes rt-mailgate to print the integer
>   ticket number to STDOUT)
>
>- capture the ticket number output by rt-mailgate and then invoke
>   rt-mailgate again with the desired %RT SET strings.
>
>That should do it.
>
>* Adam Clarke <Adam.Clarke at StrategicData.com.au> [010206 17:53]:
>>  Have you looked at the command line interface instead of e-mail.
>>
>>  This would allow you to do what you want. I have only looked at this for a
>>  second but an expect script would handle the process easily. Alternatively
>>  you could play around with piping the responses to qt -create's prompts.
>>
>>  Hint: run the following command
>>  rt -create
>>
>>  Cheers
>>  Adam Clarke
>>
>>  ----- Original Message -----
>>  From: "Hamilton, Kent" <KHamilton at Hunter.COM>
>>  To: <rt-users at lists.fsck.com>
>>  Sent: Wednesday, February 07, 2001 10:22 AM
>>  Subject: [rt-users] Question about using a web form to create a request.
>>
>>
>>  > I was building a web form which I had planned to use to simply
>>  > force people to enter specific information when they created a
>>  > request, since right now our "average" request consists of "My
>>  > PC is broke."
>>  >
>>  > I have the form built, do data validation on the info and am
>>  > all ready to generate an email to create the ticket, two of
>>  > the things I'd like to allow I don't know if I can do.
>>  >
>>  > 1) I want allow them to set a "Requested By" date and have
>  > >    that be the initial due date.
>  > > 2) I want to set the initial priority based on selections
>  > >    they make on the form.
>  > >
>  > > So my question is: Since the ticket isn't created yet, it
>>  > doesn't look like I can use "%RT SET prio xx" in the new ticket
>>  > itself, so how can I set these short of twiddling the database
>>  > myself which I was trying to avoid by generating an email. The
>>  > form is done using ColdFusion so I could do this if there isn't
>>  > any other way. But I'd have to do some serious work to make sure
>>  > I had the correct ticket to twiddle with....
>>  >
>>  > Suggestions?
>>  >
>>  > --
>>  > Kent Hamilton <KHamilton at Hunter.COM>
>>  > Manager Systems Admin & Networking
>>  > Hunter Engineering Company
>>  >
>>  > _______________________________________________
>>  > rt-users mailing list
>>  > rt-users at lists.fsck.com
>>  > http://lists.fsck.com/mailman/listinfo/rt-users
>>  >
>>
>>
>>  _______________________________________________
>>  rt-users mailing list
>>  rt-users at lists.fsck.com
>>  http://lists.fsck.com/mailman/listinfo/rt-users
>
>--
>Happy Landings,
>
>Jon Detert
>Unix System Administrator, Milwaukee School of Engineering
>1025 N. Broadway, Milwaukee, Wisconsin 53202
>
>_______________________________________________
>rt-users mailing list
>rt-users at lists.fsck.com
>http://lists.fsck.com/mailman/listinfo/rt-users





More information about the rt-users mailing list