You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2013-07-16 16:45:18

maryellen.pecar
Member
Registered: 2012-10-10
Posts: 1

GLPI business rules - using AND and OR in the same rule

I am new to this forum so I apologize if this is posted already and I was not able to find it.

We are using GLPI 0.80.4.

In the Assistance, Ticket search, you can use AND and OR several times in the search criteria.

We would like the ability to use AND and OR in the same business rule, so that we can have fewer rules.  Currently we have 383 business rules setup.  Can this functionality be added in a new version or do you have any ideas on how to do this?

Here is an example of our rules:

If category is “PC” AND requestor_group is “ABC” then assigned_group is “USA”
If category is “PC” AND requestor_group is “ABD” then assigned_group is “USA”
If category is “PC” AND requestor_group is “ABE” then assigned_group is “USA”
If category is “PC” AND requestor_group is “OBE” then assigned_group is “EUR”
If category is “PC” AND requestor_group is “SIN” then assigned_group is “APO”

If we could use AND and OR in the same rule, then the above 3 rules would become 1 rule.

If category is “PC” AND (requestor_group is “ABC” or requestor_group is “ABD” or requestor_group is “ABE”) then assigned_group is “USA”

Any ideas?

Offline

#2 2013-07-16 17:23:30

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: GLPI business rules - using AND and OR in the same rule

Not possible.
But there is a ticket on the roadmap.


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

#3 2014-01-02 20:26:56

OSS-SOS
Member
From: PARIS
Registered: 2013-05-16
Posts: 10

Re: GLPI business rules - using AND and OR in the same rule

We encounter similar issues in the filter with several criteria in multiple fields.

We have for example the following tickets:

  • Ticket A : Assigned to - Group1 et Group2

  • Ticket B : Assigned to - Group1

  • Ticket C : Assigned to - Group2

With the following search:

  • Criteria 1 : "Statut" is "no solved"

  • Criteria 2 : And "Assigned to - Group" contains "Group1"

  • Criteria 3 : And not "Assigned to - Group" contains "Group2"

We get a wrong result with "Ticket A" and "Ticket B" while only "ticket B" should appear.

Which issue of roadmap solves this problem?

Offline

#4 2014-03-03 11:15:19

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,145

Re: GLPI business rules - using AND and OR in the same rule

I have quite the same bug using "AND NOT" : the results are the same as with "AND".
in debug mode, looking at the sql request in the where clause i have "where criteria 1 and criteria 2" whatever the operator is set to "AND" or "AND NOT".

looks like a bug.
my criteria :
ticket date >01-02-2014
AND ticket date<01-03-2014
AND NOT closedate<01-03-2014

i expect to get all the tickets created in february and not closed in february.



here is the sql WhereClause :
WHERE `glpi_tickets`.`is_deleted` = '0' AND ( `glpi_tickets`.`entities_id` IN ('2', '3', '6', '4') ) AND ( `glpi_tickets`.`date` > '2014-02-01 00:00:00' AND `glpi_tickets`.`date` < '2014-03-01 00:00:00' AND `glpi_tickets`.`closedate` < '2014-03-01 00:00:00' )

what i need :
WHERE `glpi_tickets`.`is_deleted` = '0' AND ( `glpi_tickets`.`entities_id` IN ('2', '3', '6', '4') ) AND ( `glpi_tickets`.`date` > '2014-02-01 00:00:00' AND `glpi_tickets`.`date` < '2014-03-01 00:00:00' AND NOT `glpi_tickets`.`closedate` < '2014-03-01 00:00:00' )

Last edited by LaDenrée (2014-03-03 11:23:08)


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

Board footer

Powered by FluxBB