I'm wondering if there's a way to add/edit/delete Taxonomy terms in a Rule with Drupal 7? I haven't found any way to do that.

Usecase: I'm trying to use Rules to maintain a (taxonomy) vocabulary of usernames of a certain role, so when a user's role is updated I add/remove their username.

Comments

barrett’s picture

Component: Rules Core » Rules Engine

It took me a while to sort this out also.

To create a term, the action to use is "Create a new entity" then select the "Taxonomy term" option. That will give you the input fields for setting the name of the new term and the vocabulary to which it belongs.

One gotcha with selecting the vocabulary: the direct input option expects to get the integer vocabulary id, but from what I've seen the interface uses a text machine name everywhere. I was only able to find the vid by looking in the database.

I'm assuming the edit and delete will work similarly, but I haven't tried those.

rolkos’s picture

I know that this is not exactly what you need but maybe it will help
http://nodeone.se/sv/node/754

mfoda’s picture

What about taxonomy term custom fields, has anyone been able to access these in rules? I'm fetching the term by ID using an entity reference fields that refers to the TID, but I can only see core fields being loaded (description, weight...etc).

Any ideas?

rolkos’s picture

This works for me, for now I must enter tid (term id) but it works
http://drupal.org/node/1057158#comment-4792118

Remember to change taxonomy field name before rule import.

SharonD214@aol.com’s picture

Component: Rules Engine » Rules Core

mfoda -
Did you figure out how to use Rules to access the custom fields? I'm trying to do the same thing and haven't had any luck.

Thanks
Sharon

jadhavdevendra’s picture

@sharonD214 & @mfoda
You need to select "fetch entity by property" option. That will show you all CCK fields.

tr’s picture

Issue summary: View changes
Status: Active » Fixed

This seems to have been answered satisfactorily several times. Please open a new issue if you have additional questions about this.

tr’s picture

Status: Fixed » Closed (outdated)