Help w/bizcase for RT

My company currently runs Remedy (from BMC Software) for our TT system. I’m building a business case that we can save huge ROI by moving to an open source solution. I’ve got an RT system up and running and so far I’ve been able to prove it can do everything that Remedy can do with one small exception: parsing message body for trouble ticket#. Our Remedy system currently parses the message body (if the subject doesn’t contain the ticket ID) and I need to prove that RT can do the same, before we can move forward with a hosted RT solution & support. I’m sure this is possible, just looking for any advice how I can implement.

Thanks!

Have you tried ExtractCustomFieldValues? That can use regexps to allow body text to be scanned for information to add to custom fields.

Parsing through extensions may work, but may not help you.
The problem is that any scrip on-create is executed after create. So even if you parse, and even if you find a trouble ticket number, RT has already created a new ticket for you.

I believe that what you need to do is modify the file lib/RT/Interface/Email.pm in a way that when the mail is parsed, the body is also parsed (in addition to the subject).
There are the functions called ExtractTicketId and ParseTicketId that should be slightly modified.
Then I would add the identified ticket id on the subject and let the script continue whatever it was doing.

Keep in mind this will break with every upgrade.

The actual identification of the ticket id (how you expect it to be) may be tricky though.

If you have shell access to your hosted RT solution, you could use fetchmail to pull the mail in, do a little pre-processing on it and then pipe it to rt-mailgate to be processed by RT.

Thank you all for your suggestions. The idea to modify lib/RT/Interface/Email.pm is the direction that the last person who did this took, sounds like they had success. (Look in the message body for ticket ids - #3 by geraldsnm) unfortunately, those modifications don’t work with RT4 (the last published code was for RT3 quite some time ago).

I’m currently investigating the fetchmail option, if I can parse the message in a script and insert the ticket # into the subject via script prior to inputting the message into RT that would definitely do the trick! It just seems like something the RT Dev’s’ would want to do for RT itself in general, as parsing the subject (only) seems to be a holdover from much slower computational days since i can grep a 100M File in a second the policy of only checking subject seems outdated. I just thought this may be an improvement that RT could benefit from as a whole.

If I come into any luck with modifying the message (pre-RT) I’ll post my script source here.

Thanks again for the responses/suggestions/etc.

I wrote a bash script to parse the body and place the ticketID into the subject and I thought I’d post it here for the convenience of the community!

You need to reference this script in your .fetchmailrc like so (replace “your_script_here.bash” with the name/location of the script on your file system):

user ‘username’ there with password ‘password!’ is user5 here options ssl mda “/opt/rt4/bin/your_script_here.bash | /opt/rt4/bin/rt-mailgate --url http://rt.yourinstance.com --queue YourQueue --action correspond”

Then in the script you need to replace “RT-Instance” with your RT instance name.

The script:

1 Like