[prev in list] [next in list] [prev in thread] [next in thread]
List: rt-users
Subject: Re: [rt-users] [script] Closing tickets via mail (e.g. Cc:
From: Christian Hammers <ch () westend ! com>
Date: 2004-10-28 14:36:00
Message-ID: 20041028143600.GB4928 () westend ! com
[Download RAW message or body]
On Mon, Oct 25, 2004 at 02:54:59PM +0200, Christian Hammers wrote:
> I'm looking for a way to close a ticket via email. What would be the
> best approach? My only idea is currently to create a special alias
> which then executes rt-crontool.
In case anybody has a use for it, here is a little script that accepts
mails for "done@support.mydomain.com", extracts the ticket number and
closes this ticket with a comment.
bye,
-christian-
#!/usr/bin/perl -W
# Quick and dirty script, no real return code checking.
use Sys::Syslog;
openlog("rt-mail-done", 0, LOG_DAEMON);
$mail = join("", <STDIN>);
if ($mail =~ /^Subject.*\[Ticket #([0-9]+)\]/m) {
$ticketstring = "ticket/$1";
} else {
die("No ticket number found!");
}
$cmd = "rt comment -m 'Ticket has been closed via email.' $ticketstring";
$out = "$cmd: ".`$cmd 2>&1`; chomp($out); syslog(LOG_INFO, $out);
$cmd = "rt edit $ticketstring set status=resolved";
$out = "$cmd: ".`$cmd 2>&1`; chomp($out); syslog(LOG_INFO, $out);
exit(0);
--
Christian Hammers WESTEND GmbH | Internet-Business-Provider
Technik CISCO Systems Partner - Authorized Reseller
Lütticher Straße 10 Tel 0241/701333-11
ch@westend.com D-52064 Aachen Fax 0241/911879
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Be sure to check out the RT wiki at http://wiki.bestpractical.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic