The countif() function returns the number of instances of a specified template. The instances must be descendants (e.g., children, grandchildren, etc.) or an association of the current work item to be included in the aggregation.


countif(template API name, condition)

Argument Description
template API name / association name


The template API name OR an association of the template instances to be counted.




The filter that determines instances to be included in the count.


  • The filter can include “and” and “or” to further clarify the result set to include.
  • The “active=true” or “active=false” filter can be used to restrict the result set to specifically Active or specifically Inactive work items.  Not including this filter will retrieve all instances.
  • An abbreviation for “active=true” is simply “active”

Where Available

  • Metric expression
  • Attribute expression


Where Example(s)
Metric expression

Attribute expression


countif(Initiative__t, active=true and business_unit__c = "West")

Updated on February 7, 2023

Related Articles