Rules
What is a GLPI rule?
There are several types of rules in GLPI. Rules are used to automate and simplify certain tasks. It is, for example, possible to assign an item to an entity when an inventory is uploaded, to allocate an authorisation to a user when he/she logs in, or to assign a ticket via a collector.
How do the rules work?
Rules are based on criteria and actions linked to these criteria
For example
Rules for assigning authorisations to a user
1st criterion
: Type of authentication is external (i.e. other than internal database and LDAP)2nd criterion
: User ID contains @mondomaine.com1st action
: assign self-service profile2nd action
: assign entity A3rd action
: assign recursiveness Yes
You can also play with operators (is, is not, contains, begins with, etc.) to create rules that match your needs.
What types of rules are available?
Rules for import and link equipments
Rules for assigning an item to an entity
Location rules
Rules for assigning a ticket created through a mails receiver
Authorizations assignment rules
Rules for assigning a category to software
Business rules for tickets
Business rules for assets
Transfer
Blacklists
What operators are available?
In GLPI rules, you need to use operators to be able to build your rule. For example, if login contains
@mondoamine.com orif group is
infrastructure. A number of operators are available to create your rules as explicitly and logically aspossible.
is
is not
contains
does not contain
starting with
finished by
regular expression matches
regular expression does not match
exists
does not exist
under
not under
What is a relational expression?
A relational expression is based on RegEx, which allows you to simplify your rules (provided you have some knowledge of RegEx),apply massive modifications, and apply a value via "variables". Rules of this type are already created by default in GLPI. You can see a rule of this type in administration
> rules
> rules for importand link equipments
:
This rule is used to assign a user in the user field of an asset according to the return of the 3rd criterion:
(.*)@
: means any alpha-numeric character that also contains an @.#0
: means to increment the result of the relational expression
Last updated
Was this helpful?