0

I have an "equipment" content type, which has a "manufacturer" field applied to it. The "manufacturer" field is a taxonomy term reference to a taxonomy which contains all of the manufacturers.

When "equipment" is flagged, I want a "task" to be created. The problem is, I need different tasks created depending on what manufacturer it is.

Task A applies to manufacturer terms 1,2, and 5.

Task B applies to manufacturer terms 3 and 4.

When I set this up in Rules, I use a "Data Comparison" to check what manufacturer the equipment belongs to. When I use only one manufacturer, the "Data Comparison" gives me a Direct Input to compare to, I set the comparison operator to "Equals", and I can type in, for example, 2. Everything works.

However, I want this rule to apply to manufacturers 2, 1, and 5, so I set the comparison operator to "Is One Of". Suddenly, the Direct Input Method disappears, and I'm sunk.

Is there a way in Rules to compare if a field equals one of several taxonomy terms (OR logic)?

1 Answer 1

1

The key to this problem was that the data comparison was actually comparing against a field belonging to an entity that was referenced to an entity that was referenced to the entity in question. The structure was: Task -> Ticket -> Equipment: field-manufacturer.

The solution was to specifically declare the field in Rules using "Entity has field". In this case, I was using two entity references, so I had to use "Entity has field" once to bridge to the first entity, twice to bridge to the second entity, and a third time to identify the particular field on that entity that I wanted to compare data against.

After I set the "Entity has field" conditions in place, I was able to compare data using "is one of" and it gave me a field to type in multiple TIDs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.