Alternative Ticket Creation

If we want to create our own front-end form, is there a command line
script (or whatever) we can call and pass the data to create the ticket?

Thanks,

Ryan Roland

Application Developer
Information Technology
Division of Recreational Sports
Indiana University

812.855.9617
rmroland@indiana.edu

If we want to create our own front-end form, is there a command line
script (or whatever) we can call and pass the data to create the ticket?

[ …snip…]

Hi Ryan,

We had the same requirements when we first moved to RT. We found that
the simplest way was to have a standard HTML form which tied into a
little PHP to send an email to the queue address.

We use the PHP mail function like this:

mail($queueaddress, $subject, $message, $from);

Providing that you can get the requestor to enter their email address in
the form, you can make the email to RT to appear to come from them and
thus they get an RT ticket created message.

In our environment, we have them put in their name also and build the
$from like this:

$from = “From: $email ($name)”;

I hope this make sense, I haven’t had my coffee yet!

  • Ken.

This email has passed through an IE Internet MailWall gateway
and has been screened for known viruses, potential viruses and
malicious code.

IE Internet.com MailWall (http://ieinternet.com/mailwall/)

That’s exactly what we were considering at first. However, since we are
not in charge of the university wide email system there are basically
two concerns we have with that setup. Firstly, is latency. If someone
submits a request form, it may be minutes (or in bad times, hours)
before that request email gets through to the RT box. Secondly is error
checking. It’s much more straightforward and simple to check for a
return value of 1 from a command-line script than to have to catch and
handle an email bounce. Also, since our web form front-end is on the
same box as the RT instance, it’d be simple, immediate and easy to catch
errors if we could pass the form data to a command line script which did
the same basic job as rt-mailgate. In fact, we’ve considered using
this, but haven’t figured out the details of directly calling
rt-mailgate yet and wondered if there was something already created that
wouldn’t expect an email format and would be fine with a simple text
file.

Any thoughts?

Either way, thanks Ken for the confirmation that our first inclination
was at least feasible.

Thanks,

Ryan Roland

Application Developer
Information Technology
Division of Recreational Sports
Indiana University

812.855.9617
rmroland@indiana.eduFrom: Ken O’Driscoll [mailto:rt-lists@ieinternet.com]
Sent: Monday, November 01, 2004 04:59
To: Roland, Ryan M
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Alternative Ticket Creation

If we want to create our own front-end form, is there a command line
script (or whatever) we can call and pass the data to create the
ticket?

[ …snip…]

Hi Ryan,

We had the same requirements when we first moved to RT. We found that
the simplest way was to have a standard HTML form which tied into a
little PHP to send an email to the queue address.

We use the PHP mail function like this:

mail($queueaddress, $subject, $message, $from);

Providing that you can get the requestor to enter their email address in
the form, you can make the email to RT to appear to come from them and
thus they get an RT ticket created message.

In our environment, we have them put in their name also and build the
$from like this:

$from = “From: $email ($name)”;

I hope this make sense, I haven’t had my coffee yet!

  • Ken.

This email has passed through an IE Internet MailWall gateway
and has been screened for known viruses, potential viruses and
malicious code.

IE Internet.com MailWall (http://ieinternet.com/mailwall/)

If the form is on the same box as RT, then why would it take so long to
get through mail?? Why don’t you configure the form to go to the
localhost directly? In any case, you can use rt-mailgate at the command
line.

/path-to/rt-mailgate --url http:// --queue
general --action < form_info

Read the test components of the rt-mailgate perl script.

Ramon Kagan
York University, Computing and Network Services
Information Security - Senior Information Security Analyst
(416)736-2100 #20263
rkagan@yorku.ca


I have not failed. I have just I don’t know the secret to success,
found 10,000 ways that don’t work. but the secret to failure is
trying to please everybody.
- Thomas Edison - Bill Cosby
----------------------------------- ------------------------------------On Mon, 1 Nov 2004, Roland, Ryan M wrote:

That’s exactly what we were considering at first. However, since we are
not in charge of the university wide email system there are basically
two concerns we have with that setup. Firstly, is latency. If someone
submits a request form, it may be minutes (or in bad times, hours)
before that request email gets through to the RT box. Secondly is error
checking. It’s much more straightforward and simple to check for a
return value of 1 from a command-line script than to have to catch and
handle an email bounce. Also, since our web form front-end is on the
same box as the RT instance, it’d be simple, immediate and easy to catch
errors if we could pass the form data to a command line script which did
the same basic job as rt-mailgate. In fact, we’ve considered using
this, but haven’t figured out the details of directly calling
rt-mailgate yet and wondered if there was something already created that
wouldn’t expect an email format and would be fine with a simple text
file.

Any thoughts?

Either way, thanks Ken for the confirmation that our first inclination
was at least feasible.

Thanks,

Ryan Roland

Application Developer
Information Technology
Division of Recreational Sports
Indiana University

812.855.9617
rmroland@indiana.edu

-----Original Message-----
From: Ken O’Driscoll [mailto:rt-lists@ieinternet.com]
Sent: Monday, November 01, 2004 04:59
To: Roland, Ryan M
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Alternative Ticket Creation

On Sat, 2004-10-30 at 00:04, Roland, Ryan M wrote:

If we want to create our own front-end form, is there a command line
script (or whatever) we can call and pass the data to create the
ticket?

[ …snip…]

Hi Ryan,

We had the same requirements when we first moved to RT. We found that
the simplest way was to have a standard HTML form which tied into a
little PHP to send an email to the queue address.

We use the PHP mail function like this:

mail($queueaddress, $subject, $message, $from);

Providing that you can get the requestor to enter their email address in
the form, you can make the email to RT to appear to come from them and
thus they get an RT ticket created message.

In our environment, we have them put in their name also and build the
$from like this:

$from = “From: $email ($name)”;

I hope this make sense, I haven’t had my coffee yet!

  • Ken.


This email has passed through an IE Internet MailWall gateway
and has been screened for known viruses, potential viruses and
malicious code.

IE Internet.com MailWall (http://ieinternet.com/mailwall/)


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

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

That’s exactly what we were considering at first. However, since we are
not in charge of the university wide email system there are basically
two concerns we have with that setup. Firstly, is latency. If someone
submits a request form, it may be minutes (or in bad times, hours)
before that request email gets through to the RT box. Secondly is error
checking.
[ …snip… ]

Any thoughts?

Ryan,

There is a command line tool which you can use to create a ticket. We
looked at it but preferred the email solution.

Basically, you use a web form to submit to a CGI script, which would
output a file in say the following format:

id: ticket/new
Queue: mytestqueue
Requestor: somebody@somewhere.com
Text: This is the body of the ticket

Then use a command line this to create the ticket.

rt create -t ticket -i < ticket.txt

I don’t know what the error codes are but if it works, it will output
the new ticket number which you can then push back to the user.

To use the CLI, you also need to export the following variables: RTUSER,
RTPASSWD and RTSERVER The first two are just an authorised RT user, the
last is the URL for your installation.

I personally think that this is a really messy way to do things but it
could well fit your environment.

You could also look at the Perl API, which is a lot nicer. I’m sure the
wiki has lots of nice examples.

  • Ken.

This email has passed through an IE Internet MailWall gateway
and has been screened for known viruses, potential viruses and
malicious code.

IE Internet.com MailWall (http://ieinternet.com/mailwall/)

Before I jump down this rat-hole myself…

Has anyone yet built an asset DB that hooks into RT3? One of the few
things that I do sorta miss about Keystone was the integrated asset
database…

-n

------------------------------------------------------------memory@blank.org
"Shucks, Sarge, my life sounds so exciting. Where do I get an invitation?"
(–Cate Leonard, ne.motorcycles)
http://blank.org/memory/----------------------------------------------------

The reason we’re looking at this option is that mail here at the
university is handled outside our control and our group is unfamiliar
enough with it that we cannot be sure of how things function. So we are
looking at direct access since we’re on the local box anyway.

I have tested the use of the CLI rt and it seems to work very well for
the majority of our needs. However, the documentation on it is sparse
and there are two questions that I’m running into.

  1. Can you set custom fields through this interface?

I have tried adding the following to the ticket data file:

cf_fieldname: value

I’ve also tried to use the ‘set’ action with the rt command as follows:

cat ticket_data | rt create -t ticket -i set cf_fieldname=value

Neither of those seem to work.

  1. How can a non-user create a ticket through this interface?

We have it setup so that everyone can create a ticket and it uses the
email address as the username with no passwd.

So I tried

export RTUSER=email@address.com

export RTPASSWD=

export RTSERVER=http://rt.web.server.addr/

Before running rt, but it complained of an incorrect username or
password.

Any suggestions would be helpful.

Thanks,

Ryan Roland

Application Developer

Information Technology

Division of Recreational Sports

Indiana University

812.855.9617

rmroland@indiana.eduFrom: Ramon Kagan [mailto:rkagan@yorku.ca]

Sent: Monday, November 01, 2004 09:10

To: Roland, Ryan M

Cc: rt-users@lists.bestpractical.com

Subject: RE: [rt-users] Alternative Ticket Creation

If the form is on the same box as RT, then why would it take so long to

get through mail?? Why don’t you configure the form to go to the

localhost directly? In any case, you can use rt-mailgate at the command

line.

/path-to/rt-mailgate --url http:// --queue

general --action < form_info

Read the test components of the rt-mailgate perl script.

Ramon Kagan

York University, Computing and Network Services

Information Security - Senior Information Security Analyst

(416)736-2100 #20263

rkagan@yorku.ca

I have not failed. I have just I don’t know the secret to
success,

found 10,000 ways that don’t work. but the secret to failure is

                           trying to please everybody.

  - Thomas Edison                     - Bill Cosby

That’s exactly what we were considering at first. However, since we
are

not in charge of the university wide email system there are basically

two concerns we have with that setup. Firstly, is latency. If
someone

submits a request form, it may be minutes (or in bad times, hours)

before that request email gets through to the RT box. Secondly is
error

checking. It’s much more straightforward and simple to check for a

return value of 1 from a command-line script than to have to catch and

handle an email bounce. Also, since our web form front-end is on the

same box as the RT instance, it’d be simple, immediate and easy to
catch

errors if we could pass the form data to a command line script which
did

the same basic job as rt-mailgate. In fact, we’ve considered using

this, but haven’t figured out the details of directly calling

rt-mailgate yet and wondered if there was something already created
that

wouldn’t expect an email format and would be fine with a simple text

file.

Any thoughts?

Either way, thanks Ken for the confirmation that our first inclination

was at least feasible.

Thanks,

Ryan Roland

Application Developer

Information Technology

Division of Recreational Sports

Indiana University

812.855.9617

rmroland@indiana.edu

-----Original Message-----

From: Ken O’Driscoll [mailto:rt-lists@ieinternet.com]

Sent: Monday, November 01, 2004 04:59

To: Roland, Ryan M

Cc: rt-users@lists.bestpractical.com

Subject: Re: [rt-users] Alternative Ticket Creation

If we want to create our own front-end form, is there a command line

script (or whatever) we can call and pass the data to create the

ticket?

[ …snip…]

Hi Ryan,

We had the same requirements when we first moved to RT. We found that

the simplest way was to have a standard HTML form which tied into a

little PHP to send an email to the queue address.

We use the PHP mail function like this:

mail($queueaddress, $subject, $message, $from);

Providing that you can get the requestor to enter their email address
in

the form, you can make the email to RT to appear to come from them and

thus they get an RT ticket created message.

In our environment, we have them put in their name also and build the

$from like this:

$from = “From: $email ($name)”;

I hope this make sense, I haven’t had my coffee yet!

  • Ken.

This email has passed through an IE Internet MailWall gateway

and has been screened for known viruses, potential viruses and

malicious code.

IE Internet.com MailWall (http://ieinternet.com/mailwall/)


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

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