Rules: fire at adding term only when one of this term anscestors is other specific term I'm trying to add menu items programatically by using rules - the item should be added after user will create a term, but I need a specific condition that I cannot accomplish - fire rule only if ONE OF THE ANCESTORS of created term is specific term. So for example if I have hierarchy:

Term 1
Term 2
 - Term 2.1
 - Term 2.2
   -Term 2.2.1


I would like the rule to fire when the added term is 2.x.x.x... How can I accomplish this? I was trying for few hours different approaches without luck.
Write your own condition for rules

function mymodule_rules_condition_info() {
  return array(
    'mymodule_condition_needs_veryfication' =&gt; array(
      'label' =&gt; t('ONE OF THE ANCESTORS of created term is specific term'),
      'group' =&gt; t('mymodule'),
      'arguments' =&gt; array(
        'aplication_node' =&gt; array(
            'type' =&gt; 'node',
            'label' =&gt; t('A fancy condition'),
        ),
      ),
      'module' =&gt; 'mymodule',
    ),
  );
}
function mymodule_condition_needs_veryfication($node) 
  if(condition($node))
    return true;
  return false;
}