Community & Support

Creating a trigger that fires when a new node is created with a specific taxonomy term

I'm working on a site where I need different roles to be asked to approve a new node, depending on which term the node is tagged with. I'm using Actions 5.x-2.5 and Workflow 5.x-2.2 to set up the workflow.

I think that I have to write a trigger to fire based on the terms assigned to a new node. Has anyone done something similar and would be able to provide some guidance?

I know that there is a Taxonomy Actions module, but it doesn't quite seem to be appropriate here because it apparently defines taxonomy actions rather than triggers. (Also, I haven't managed to get it to actually show up anywhere in the Actions and Triggers setup pages, but that's probably just me.)

Comments

I'm attempting the same thing

I'm attempting the same thing in Drupal 6, did you have any success?

Regards,
Danielle

Similar in Drupal 7

I'm trying to do something similar. I've only just begun my research into this particular desired functionality, but I figured I would drop a comment here, even though this is really old. I'm not using taxonomy, but the basic idea of something happening when a user goes to create a new node of a certain content type (extremely similar to one of a certain Taxonomy, still a new node). I've discovered lots of terminology and modules: Workflow (not at d7 yet...), Rules, Triggers, Actions, Workbench (haven't looked into yet though), and even contemplated using Conditional Fields with Computed Field, which I may revisit.

Basically, I want the timestamp of node creation (not save), to be recorded as a field for/in the node. Any future lurkers out there, feel free to comment here, I will post my answer if/when I find it, so if you don't see another comment here, please share your knowledge haha.

_

You should be able to do this with rules without custom code. Otherwise, I'd consider custom coding into it right into a hook_node_insert. You should also be able to do it with a custom trigger and action, but hook_node_insert is more direct.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.