[rt-users] custom scrip, user-defined condition on custom field

Bob Goldstein bobg at uic.edu
Wed Jul 7 16:13:16 EDT 2004


There is the general question of "give RT commands by email".

There was an enhanced-mailgate, for RT 2.x, available from
http://download.bestpractical.com/pub/rt/contrib/2.0/rt-addons/

I adapted this for RT 3. It works for my current needs; you are
welcome to the code, but let me explain first, since it
may not suit you.

I overrode lib/RT/Interface/Email_Overlay.pm::Gateway(), as well
as adding some auxiliary subroutines for parsing
specially-formatted email. (And then I have a special rt-mailgate
that parses mail that I deal with, and re-formats it to fit the
internal RT format for adding commands.)

If the incoming mail does not refer to an existing ticket,
obviously it needs to create a new ticket.  The special
format can be used to set various fields.  I use it to
set a custom field.  You could use it to set the status to
'resolved', thereby creating and auto-resolving a ticket.

If the incoming mail refers to an existing ticket,
it can, in some circumstances be used to execute commands
instead of appending text.  Your guys could use this
to take, resolve, etc.

* There is no security.  Anyone could fake an address, guess
  at a problem number, and close tickets, move them, etc.  I can
  live with this risk, but I know Jesse wanted better.  He did mention
  he's preparing to deal with PGP sigs in an upcoming release.
  You might want to wait for a more offical version of this.

* I have really only tested the "set custom field upon creation"
  part. I think the "set status upon creation" would also work,
  but I'd have to test it first. In general, the parts I use work
  well, and the other parts are not yet tested. This is one
  reason I have not uploaded this to the wiki. Caveat emptor.

* If giving commands for existing tickets does not work, it's
  probably a minor bug. However, it is set up right now to
  require a new address.  So if you normally send appends
  to myrt.mycorp.com and comments to myrt-comment.mycorp.com,
  you would send commands to myrt-commands.mycorp.com.
  I want to find a way to allow both appends and commands in
  the same note, to be sent to the normal address.  But that is
  not coded yet, let alone tested.


So, if you want the code on an as-is basis, send me a private note.

   bobg




>Hey guys,
>
>I want certain tickets to resolve automatically. The story and reason for
>this may be long but in short it's that i wrote a certain script that
>recieves mail, parses it and creates a ticket(by sending mail). But the
>problem is that thise tickets remain new and unowned!
>
>Then another problem is that i want guys at work to resolve and own tickts
>by mail,..just sending to our rt instance...Is that possible?
>
>All help appreciated
>---
>Wilson
>
>_______________________________________________
>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>Be sure to check out the RT wiki at http://wiki.bestpractical.com
>
>
>
>!DSPAM:40ec055c304053809110330!
>
>



More information about the rt-users mailing list