Cmd line ticket creation

I’m using RT 1.0.6

I looked thru the contrib dir and I don’t see what I’m looking for.

I’m building a php app that takes an order and manipulates data in our
database. At the same time I need to create a ticket for the provisioning
group and place that ticket number in the db with the order.

So, I need a way to create that ticket and get the number back. I’ll
probably just shell out to a perl script. I looked at
manipulate::cli_create_req and it is not suited for that.
It requires interactive question answering.

So I’m going to write a little wrapper that will use rt::add_new_request()
to create the ticket. I’ll post it here when it’s done. Should I take the
time to make it a sub in manipulate.pm and provide a patch? Call it
something like cli_create_req_noninteractive (i can’t think of a good
word). It could then become an option on the rt CLI.

p.s. www.fsck.com apparently has it’s default data type set to text/html.
Can you change that to text/plain? Documents like this are really
difficult to read:
http://www.fsck.com/pub/rt/contrib/xrts-0.1.tar.gz.README

Dale Bewley - Bewley Internet Solutions Inc. http://bewley.net/

I’m using RT 1.0.6

I looked thru the contrib dir and I don’t see what I’m looking for.

I’m building a php app that takes an order and manipulates data in our
database. At the same time I need to create a ticket for the provisioning
group and place that ticket number in the db with the order.

So, I need a way to create that ticket and get the number back.

RT2 cleans this up a lot. the CLI ticket create can be done non-interactively
(though it’s not fully functional in 1.3.70)

For now, I’d actually recommend doing a shell escape and calling the mail
gateway in --extended mode. it has a flag that will return the ticket id
of the ticket which was created…

p.s. www.fsck.com apparently has it’s default data type set to text/html.
Can you change that to text/plain? Documents like this are really
difficult to read:
http://www.fsck.com/pub/rt/contrib/xrts-0.1.tar.gz.README

Setting the default type to text/plain makes a bunch of other higher-priority
stuff break :confused:


Dale Bewley - Bewley Internet Solutions Inc. http://bewley.net/


Rt-devel mailing list
Rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“If IBM wanted to make clones, we could make them cheaper and faster than
anyone else!” - An IBM Rep. visiting Vassar College’s Comp Sci Department.

I’m building a php app that takes an order and manipulates data in our
database. At the same time I need to create a ticket for the provisioning
group and place that ticket number in the db with the order.

So, I need a way to create that ticket and get the number back.

RT2 cleans this up a lot. the CLI ticket create can be done non-interactively
(though it’s not fully functional in 1.3.70)

For now, I’d actually recommend doing a shell escape and calling the mail
gateway in --extended mode. it has a flag that will return the ticket id
of the ticket which was created…

Awesome. That will work dandy. Thanks.

p.s. www.fsck.com apparently has it’s default data type set to text/html.
Can you change that to text/plain? Documents like this are really
difficult to read:
http://www.fsck.com/pub/rt/contrib/xrts-0.1.tar.gz.README

Setting the default type to text/plain makes a bunch of other higher-priority
stuff break :confused:

OK. Can you possibly rename files to .txt or drop in a .htaccess
with ‘AddType text/plain .README’ in it. nudge nudge :wink:

Dale Bewley - Bewley Internet Solutions Inc. http://bewley.net/

well, if anyone was mildly curious what I did, this is the basic php code
I used to make the ticket and get back the ticket number. It can use some
error handling and needs to formatting for the ticket body done.

function make_ticket() {
$body ="From: test@test

This is a test.
“;
$filename = tempnam(”/tmp",“tick”);
$outfh=popen(“/opt/rt/bin/rt-mailgate --extended-syntax -a
correspond -t -q todo 2>&1 > $filename”,“w”);
fwrite($outfh,$body);
fflush($outfh);
pclose($outfh);
$infh = fopen(“$filename”,“r”);
$ticket_number = fread($infh,256);
$ticket_number = str_replace(“\n”,“”,$ticket_number);
fclose($infh);
unlink($filename);
return $ticket_number;
}

Dale Bewley - Bewley Internet Solutions Inc. http://bewley.net/