Aborting ticket creation via scrip

I’m trying to find a way to get RT not to create a ticket when it
receives an email that matches certain criteria (is in a specific queue,
subject matches or doesn’t match a regex, content lines match or don’t
match a specific regex).

I’ve written the scrip and if a given check fails, I ‘return undef;’,
but RT creates the ticket anyway. Is there any way to avoid this? I’ve
searched the archive, and have come up empty.
O. Ododa

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’m pretty sure this isn’t possible with a scrip. What you could do is
on create set the status to “deleted” when matching your criteria.

Joby Walker
ITI SSG, University of Washington


PGP key: https://staff.washington.edu/joby/joby-u-pub.asc

O. Ododa wrote:

I’m trying to find a way to get RT not to create a ticket when it
receives an email that matches certain criteria (is in a specific queue,
subject matches or doesn’t match a regex, content lines match or don’t
match a specific regex).

I’ve written the scrip and if a given check fails, I ‘return undef;’,
but RT creates the ticket anyway. Is there any way to avoid this? I’ve
searched the archive, and have come up empty.

O. Ododa


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC3CV2gA0gpghkf88RAibJAJ0ZeLdmnKDHByPaQNMNPG7ZOWGV/QCfYSHf
0rkuHb7Z63vDTtV2K21Kubs=
=876g
-----END PGP SIGNATURE-----

Joby Walker wrote:

I’m pretty sure this isn’t possible with a scrip. What you could do is
on create set the status to “deleted” when matching your criteria.

Correct; the scrip only fires once the ticket is created. It
can’t prevent the creation.

Another approach would be to filter the mail (using procmail or
Mail::Audit or whatever you like) prior to injecting into RT.

As others wrote, its not possible because of processing order.

http://wiki.bestpractical.com/index.cgi?WriteCustomAction

 * Create transaction
 * Find condition matches
 * Execute preparation code scrip by scrip
 * Scrips that fail will be thrown away
 * Execute commit code of surviving scrips proceeding scrip by scrip

Ruza

O. Ododa wrote:

I’m trying to find a way to get RT not to create a ticket when it
receives an email that matches certain criteria (is in a specific queue,
subject matches or doesn’t match a regex, content lines match or don’t
match a specific regex).

I’ve written the scrip and if a given check fails, I ‘return undef;’,
but RT creates the ticket anyway. Is there any way to avoid this? I’ve
searched the archive, and have come up empty.

O. Ododa


The rt-users Archives

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

Pavel Ruzicka, HelpDesk ICZ

*** HelpDesk ICZ a.s. *********************
Hvezdova 1689/2a, 140 00 Prague 4, CZ
tel: +420 24 41 00 111 _
Fax: +420 24 41 00 222 @_}-,^–`–
GSM: +420 724 429 767
mailto:pavel.ruzicka@i.cz http://www.i.cz

O. Ododa wrote:

receives an email that matches certain criteria (is in a specific queue,
subject matches or doesn’t match a regex, content lines match or don’t
match a specific regex).

If it’s in a queue, the ticket is already created :slight_smile:

If you must do this within RT (instead of filtering out the e-mail
before it enters RT), you probably want to write a scrip that simply
deletes or rejects the ticket. You’ll also want to modify auto-reply or
notify scrips to prevent them from sending e-mail.

Rick Russell
For computer help, call xHELP (x4357 or 713-348-4357)
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98 F5E5 5C8C 56CA C7CB B669
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267 Fax: 713.348.6099

Thanks for all the replies and assistance. For a while, I thought “I’m
out of the office until *” in german would be the only reply I’d see :slight_smile: .
O. Ododa