Page 1 of 1

Feature: Fill 'fields' automatically from body text

Posted: 05 Feb 2018, 15:36
by mpa
Looking for a way to automatically fill fields from body text.
Like eg. priority and severity.

Priority = high
Severity = low

So when a email arrives with, for example, above text in the body, the fields 'priority' and 'severity' should be filled in automatically.

Would also be nice if custom fields automatically can be filled this way.

Appreciate any help on this wanted feature.

Max.

Re: Feature: Fill 'fields' automatically from body text

Posted: 05 Feb 2018, 17:46
by SL-Gundam
Currently this is not yet possible. There is a rule system in development but its going to be a long while before its ever finished

Priority is possible. This uses the priority of the email itself. Send an email with low priority results in a ticket with low priority
Severity is not possible at the moment, same for custom fields. Default values are filled properly though

Re: Feature: Fill 'fields' automatically from body text

Posted: 05 Feb 2018, 22:46
by Starbuck
Suggestion: Add an event hook prior to posting a new ticket. This will give new plugins an opportunity to scan an inbound email, and to set an array with values that will be used in the final post. This will allow a great variety of customizations from the field, avoiding the need to build every possible desire into your core plugin.

Re: Feature: Fill 'fields' automatically from body text

Posted: 06 Feb 2018, 04:32
by SL-Gundam
If you checked the plugins code you would have noticed that that is already present ;)

https://github.com/mantisbt-plugins/Ema ... g.php#L275
https://github.com/mantisbt-plugins/Ema ... g.php#L278

Re: Feature: Fill 'fields' automatically from body text

Posted: 06 Feb 2018, 22:38
by Starbuck
Well, it's great that the feature is there. But you just told someone that they couldn't do something, and yet apparently they can. I'm guessing you just weren't thinking along those lines when you answered. No prob. Yes, the event is fired here.

I am involved in other code, don't want to get into yours. As a casual observer I'm just saying it would have been nice if that "no" answer was "yes" with a reference to info on how to use that hook. I actually had the same question a couple months ago. I'm glad we can add custom data into inbound email. I'm hoping that at some point an example of it's usage can be provided here. I did a search for EVENT_ERP_BUGNOTE_DATA and did not find it mentioned here.

Thanks.

Re: Feature: Fill 'fields' automatically from body text

Posted: 07 Feb 2018, 03:23
by SL-Gundam
Technically speaking everything is possible. 99.99% of the people are only interested what it can do without any work from them. Lucky you, you're the other 0.01%
I've given the answer that people can write their own plugins or modify EmailReporting as they wish a lot of times and nobody was ever interested (you're the first seriously). You get tired of giving the answer and people not being interested

For new issues it handles exactly the same as its MantisBT counterpart. The note version on the other hand works like a new issue, not like its MantisBT counterpart
http://mantisbt.org/docs/master/en-US/D ... ortbugdata

Every plugin needs to publish the events it wants to use in the hooks function and the ones it makes available in the events function. So its not that hard to track that down.
https://github.com/mantisbt-plugins/Ema ... g.php#L268
You should only use the EmailReporting specific events if you only want to run your code on EmailReporting events.
The MantisBT couterparts will also trigger when EmailReporting add new issues or notes

Documentation is available here
https://github.com/mantisbt-plugins/Ema ... L.txt#L191

Re: Feature: Fill 'fields' automatically from body text

Posted: 07 Feb 2018, 21:21
by Starbuck
SL-Gundam wrote: 07 Feb 2018, 03:23I've given the answer that people can write their own plugins or modify EmailReporting as they wish a lot of times and nobody was ever interested (you're the first seriously). You get tired of giving the answer and people not being interested
I completely get that concept (common in FOSS) and it's my motivation for working with @Atrol to kick off the new plugin forum. I understand the challenges and frustrations that lie ahead.

As you continue encourage people to work out more creative solutions :roll: , please don't hesitate to recommend that they continue their search in the General Plugins section.

And Thanks for the insight into the ERP. I will be looking into the code at some point and may use ERP as a model for examples of how to create new plugins for site-specific needs. Please don't hesitate to ping me with comments, advice, or questions on how we can do this all better. I look forward to more exchanges with you.

Re: Feature: Fill 'fields' automatically from body text

Posted: 07 Feb 2018, 23:44
by SL-Gundam
I'm noticing now that you are not the original person starting this topic. :oops:

I'm looking forward to working with you as well

Re: Feature: Fill 'fields' automatically from body text

Posted: 21 Mar 2018, 21:53
by mpa
Hi SL-Gundam and Starbuck,

Thank you both for your thourough replies on this matter, but unfortunatly I am not capable of making a new plugin by myself.
Lack of programming skills i am afraid. :(

Any further assistance on this subject will be very much appreciated....

kind regards.

Re: Feature: Fill 'fields' automatically from body text

Posted: 21 Mar 2018, 22:17
by SL-Gundam
I'm willing to answer any questions you have but i can't teach you coding.

If you cannot do it yourself I suggest you find somebody that is willing to code customizations specific to your requirements. Usually that costs money i'm afraid.

Another option is to have a lot of patience and wait for EmailReporting to bring support for this. That could be years though as the system currently in development is quite complex

Re: Feature: Fill 'fields' automatically from body text

Posted: 23 Mar 2018, 00:59
by Starbuck
@mpa (Max) - you are right at the heart of the new Plugin initiative. I will be posting notes about FOSS value and motivation soon. In short, you're faced with a simple challenge: You need to figure out some way to motivate someone to give up something they have (time and skills) in order to provide you with something you want. This isn't about code or money. It's about value. And this isn't about you. This is the same challenge everyone faces with FOSS and otherwise.

In essence, you value the time it's taking you to copy text into ticket fields. You might be looking to spend more time on-the-clock for clients, or you might be trying to get more done for an employeer. Whatever the situation, you've placed Value on the time being consumed on this activity.
Other people value their time too. Being in the position of consumer here, it's up to you to figure out what will motivate someone to write code that will save you time to do whatever else you want.

Consider offering your consultation, services, food, products, discounts, referrals, or whatever you have that someone else might value.

HTH