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.
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…
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…
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;
}