tomolimo / mailanalyzer

Mail Analyzer GLPI Plugin may be used to combine CC mails into one Ticket
25 stars 10 forks source link

Question - request for help #10

Closed koda0601 closed 7 years ago

koda0601 commented 7 years ago

Hello, I am using mailanalyzer plugin and works very well. You are very helpful person and hope you answer ma question ;-) My users are rather lazy ;-) and send requests mails directly to me or my colleague. Then we forward it to glpi and your plugin replace the real requester I want to extend this plugin to assign tech person automatically. For example if I send mail this should be automatically assigned to me. The code may be not "elegant". Could you help me with this? I think it is similar to: if( $locUser->getFromDB( $row['id'] ) ) { // set users_id $parm->input['users_id'] = $locUser->getID() ; //$parm->input['_users_id_requester'] = $locUser->getID() ; } but need to know the input key... Thanks in advance ;-)

tomolimo commented 7 years ago

Hello, Do you want to modify the plugin, or write a new plugin? Anyway you may write a rule to assign automatically a technician to a ticket. regards, Tomolimo

koda0601 commented 7 years ago

Hi, just to modify the plugin.. Can you help me how to write a rule? I couldn find creator of request in rule or I am blind ;-)

2017-03-06 11:33 GMT+01:00 tomolimo notifications@github.com:

Hello, Do you want to modify the plugin, or write a new plugin? Anyway you may write a rule to assign automatically a technician to a ticket. regards, Tomolimo

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tomolimo/mailanalyzer/issues/10#issuecomment-284359837, or mute the thread https://github.com/notifications/unsubscribe-auth/AQo6uQVuoADjwmhueDo6UgYNKAOAIP_zks5ri-EWgaJpZM4MT4b2 .

tomolimo commented 7 years ago

Good remark, ticket writer is not in the list for criterion

tomolimo commented 7 years ago

so the only solution you have is to write a new plugin, (or to modify an existing plugin, but this is really bad as at each new release you'll have to redo your modification)

koda0601 commented 7 years ago

Yes, I know that, but I always control you plugin before update ;-) I know that must insert to glpi_tickets_users but wonder is it possible to use $parm->input in your hook and how to read ticket creator?

2017-03-06 12:00 GMT+01:00 tomolimo notifications@github.com:

so the only solution you have is to write a new plugin, (or to modify an existing plugin, but this is really bad as at each new release you'll have to redo your modification)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tomolimo/mailanalyzer/issues/10#issuecomment-284365792, or mute the thread https://github.com/notifications/unsubscribe-auth/AQo6uYxQgUz8_VXWfZBeJNlOzhhKo6wOks5ri-dNgaJpZM4MT4b2 .

tomolimo commented 7 years ago

ticket creator (=ticket writer =email sender) is $param->input['users_id_recipient']

koda0601 commented 7 years ago

Thanks ;-) one more question: during your hook (mailanalyzer) is the id of ticket know? Or is it triger before it is saved to db? I am not familiar with plugins ...

2017-03-06 12:35 GMT+01:00 tomolimo notifications@github.com:

ticket creator (=ticket writer =email sender) is $param->input['usersid recipient']

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tomolimo/mailanalyzer/issues/10#issuecomment-284372856, or mute the thread https://github.com/notifications/unsubscribe-auth/AQo6uaXzR7jismLc5sW53ZdxuwExN2vJks5ri--AgaJpZM4MT4b2 .

tomolimo commented 7 years ago

plugin_pre_item_add_mailanalyzer is before ticket creation then ticket id is not known and plugin_item_add_mailanalyzer is after ticket creation then id is in $parm->fields['id'],

koda0601 commented 7 years ago

Thank you very much. It works! ;-)

2017-03-06 14:07 GMT+01:00 tomolimo notifications@github.com:

plugin_pre_item_add_mailanalyzer is before ticket creation then ticket id is not known and plugin_item_add_mailanalyzer is after ticket creation then id is in $parm->fields['id'],

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tomolimo/mailanalyzer/issues/10#issuecomment-284391112, or mute the thread https://github.com/notifications/unsubscribe-auth/AQo6uZvp3huDRs3n9VXfLozxnQH8c7Vnks5rjAUqgaJpZM4MT4b2 .

tomolimo commented 7 years ago

you're welcome