Previous Topic: Specify an Action to PerformNext Topic: Attribute Filter Syntax


Limit the Availability of Menu Items

The <filter> element specifies a filter that further restricts the enabled state of the menu item. You can filter on any attribute of the selected context. For example, the following code shows that the action needs the IP address of the alerted CI. Therefore, it is enabled only if the CI has the IP address attribute populated.

<filter>
   <has-attribute>AttributeID.NETWORK_ADDRESS</has-attribute>
</filter>

You can specify complex attribute filters with any combination of nested, and, and or filters.

For more information, see Attribute Filter Syntax.

Example: Nested Filters

The following example enables the item if the selected model has the Network_Address attribute and the Condition (ID 0x1000a) attribute is RED.

<filter>
   <and>
      <has-attribute>AttributeID.NETWORK_ADDRESS</has-attribute>
    <equals>
      <attribute id="AttributeID.CONDITION">
         <value>43</value> <!--red-->
      </attribute>
    </equals>
   </and>
</filter>