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 2010-04-06 10:55:16

Chad_Gray
Member
Registered: 2010-03-10
Posts: 7

Assign entity from TAG

I'm struggling a bit with creating a rule to automatically assign an Entity to PCs based upon their TAG.

I have created Entities with the same name as the TAG field from OCS, and I've created a rule as follows:

Criteria Section:

Criteria     Condition     Reason
OCS TAG    Regex checks    /([a-z\ A-Z]+)/

Actions section:
Fields            Action type            Value
Entity from TAG    Assign value from regex    #0

In debug mode, I can see that "#0" holds the name of the tag field, which matches an entity, but when testing the rule the entity assigned is blank.

The entities have been created under a parent entity - does this make a difference? Do I need to assign the Entity as something like "Parent Entity > #0" ?

Any help greatly appreciated :-)

Thanks!

Offline

#2 2010-04-06 11:16:40

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

Re: Assign entity from TAG

> I have created Entities with the same name as the TAG field from OCS, and I've created a rule as follows:

The TAG is not the name of the entity.
The TAG must be filled in the "Entity TAG" field

+


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 2010-04-06 11:35:27

Chad_Gray
Member
Registered: 2010-03-10
Posts: 7

Re: Assign entity from TAG

Ah, got it - thank you!

For anybody else who wants to know how this works, if you go to:
Admin -> Entites and select an Entity, you will see there is a field called "Entity TAG"

I have populated this with the name of my OCS TAG for each corresponding Entity.

The regex match in the rule detailed in the initial post takes the value of the OCS TAG field.
The actions part of the rule then looks for this value (#0) in the "Entity TAG" field of your entities, and if it finds a match then that entity is assigned.

The use of the TAG field confused me as I had not seen the "Entity TAG" field and thought it was still referring to the OCS TAG.

Thanks for the help!

Offline

Board footer

Powered by FluxBB