Page 1 of 1

OTRS ---> Mantis ... Clean email

Posted: 13 Nov 2017, 11:42
by i200

Recently i installed MantisBT and configured EmailReporting plugin and works wonderfull ... Thanks to all the developers of the plugin, uve done a really nice job!

I use it to create tickets in Mantis that come via email from OTRS. When a ticket is created the part that i need is between two identical tags:

<snip>text describing error<snip>

Ive read the documentation and seems i cant get rid of the rest of the email parts from the plugin.

If someone could point me to where the emails are processed maybe i could change it to seacrh for "<snip>" and just register as a ticket the text from there to the next "<snip>". Any advice or tip would be appreciated.

Allso thought that maybe this could be easier achieved from the HTML parser ... Sorry if its sounds crazy, but i have no previous experience with Mantis.

Thanks in advance for any help.

Re: OTRS ---> Mantis ... Clean email

Posted: 13 Nov 2017, 17:28
by SL-Gundam
Somewhere in the far future there should be a rule system with which this might be possible... but for the moment you will have to modify EmailReporting yourself

Assuming you only want this for new issues, not notes. There are 2 options
  1. Create a plugin that hooks into the EVENT_ERP_REPORT_BUG_DATA event
  2. Add a new function after this line $t_description = $p_email[ 'X-Mantis-Body' ];. That function should then modify $t_description and return the new value
I would prefer the first solution since it will allow easy updating of EmailReporting without losing your own modifications. Option 2 might be easier to implement though

Re: OTRS ---> Mantis ... Clean email

Posted: 14 Nov 2017, 11:38
by i200
Thanks for the quick reply!

... /mantisbt/plugins/EmailReporting/core/mail_api.php ...

Just had a quick look and 2nd option seems much easier to achieve, i dont know the specifics of a Mantis Plugin development.

Thanks again :-)

Re: OTRS ---> Mantis ... Clean email

Posted: 14 Nov 2017, 17:37
by SL-Gundam
Plugin development requires a little bit more work and option 2 is easier to implement but in the long run option 1 would pay back its investment in my opinion.

If you would consider it i would suggest the following course of action.
  1. Make a copy of the "Gravatar" plugin folder
  2. rename the new folder and Gravatar.php (make sure they have the same name except for the file extension)
  3. Modify the [new name].php file as needed. It already includes EVENT hooks so that you'll need to modify very little