You are not logged in.
Hi to All.
Q1:
I want ticket submitted by user (by email) to became in user's entity.
I.e. user "A" with email "E" are in entity "O", email sent from "E" creates ticket for organization "O".
Is it possible (how?) or planned?
P.S. As I understand, user may belong to many orgs in same time. It makes a bit difficult to sort mail/tickets in such way. In this case ticket can go to "first" or parser's entity.
Q2:
Is it possible to change ticket's entity?
Thanks in advance and sorry for english.
Multiple GLPI instances. Thanks to developers!
Offline
Q2: solved
Multiple GLPI instances. Thanks to developers!
Offline
Q1 update, about automatic assigning email ticket to entity.
My configutation.
1) Many workers from many organizations send email to ONE support mailbox. Using one mailbox we can't create different mailgate parsers for different organizations. Creating own mailbox for every organizations is... not good idea, next step will be printing own business cards for every customer ;-).
2) Each organization corresponds to entity in GLPI.
3) Each worker corresponds to user in GLPI's entity. User's email may be in corporate domain, i.e. username@someorg.tld for each org's user or in different domains for users in same org. In first case we can automatically assign ticket to entity using one rule, in second case it's to complicated - rule for every worker.
To resolve this proble I added few lines of code to buildTicket() in mailgate.class.php.
if (!$exists) {
unset($tkt['tracking']);
// Mail followup
$tkt['uemail']=$head['from'];
$tkt['emailupdates']=1;
// Which entity ?
$tkt['FK_entities']=$this->entity;
/// Added
$query="SELECT FK_entities from glpi_users WHERE email='".$head['from']."'";
$result=$DB->query($query);
if ($result&&$DB->numrows($result)) {
$tkt['FK_entities']=$DB->result($result,0,"FK_entities");
}
Multiple GLPI instances. Thanks to developers!
Offline
I understand you needs esposed in point 1.
This feature is planned but not also simple as it seems.
You could have a look at this thread (in french but google have good translation) : http://glpi-project.org/forum/viewtopic.php?id=12367
JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au projet GLPI : Soutenir
Offline
Point 2 and 3 are very specific...
There is a open ticket about such a feature for a future version.
Regards.
Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/
Offline
Merci!
I'll go to train my extremely poor French while reading corresponding thread ;-)
Multiple GLPI instances. Thanks to developers!
Offline
Taras' example worked for me with some tweaking. We are a multi-department organization that all emails for entire organization go to one email address. I spent many hours trying to make rules work using the submitter's group. This is the altered code I used to get mine working. What it does is create the ticket with the correct entity assigned to the user.
$query="select glpi_users_profiles.FK_entities from glpi_users , glpi_users_profiles where glpi_users.email='".$head['from']."' and glpi_users_profiles.FK_users = glpi_users.ID";
$result=$DB->query($query);
if ($result&&$DB->numrows($result)) {
$tkt['FK_entities']=$DB->result($result,0,"FK_entities");
}
Trying the same approach to assign the user's group to the ticket but so far haven't been able to get it to work.
Live Instance >> CentOS 5.6 x64 | Apache-2.2.3 | PHP-5.1.6 | MySQL-5.0.77 | Kernel 2.6.18-194.el5 | GLPI v0.80.2 | OCS 2.0RC3 (~500 units)
Dev Server >> Same as above
Offline
Your solution work only if a user is affected to only one entity
MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI : Support Contribute References Freshmeat
Offline
Your solution work only if a user is affected to only one entity
I understand.
I think, that this change can be added to GLPI with additional check if user assigned to only one entity.
Multiple GLPI instances. Thanks to developers!
Offline
MoYo wrote:Your solution work only if a user is affected to only one entity
I understand.
I think, that this change can be added to GLPI with additional check if user assigned to only one entity.
Ah didn't realize it was for one entity per user. My entity structure only has one per user anyways so missed that part.
I've also want to get working what was mentioned earlier , that is assign to user's group on ticket creation. I tried the same approach from what I posted above, but did not have luck ; that and all my users belong to two groups at least. Even if it created the ticket with only one of the user's groups that would be great but can't seem to find information in the db tables that can be used to match user ID to a group.
Live Instance >> CentOS 5.6 x64 | Apache-2.2.3 | PHP-5.1.6 | MySQL-5.0.77 | Kernel 2.6.18-194.el5 | GLPI v0.80.2 | OCS 2.0RC3 (~500 units)
Dev Server >> Same as above
Offline
... but can't seem to find information in the db tables that can be used to match user ID to a group.
Information you need (as I understand) located in glpi_users_groups:
mysql> describe glpi_users_groups;
+-----------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| FK_users | int(11) | NO | MUL | 0 | |
| FK_groups | int(11) | NO | MUL | 0 | |
+-----------+---------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
Multiple GLPI instances. Thanks to developers!
Offline