Math Functions
Overview
The math functions (min, max, avg) allow you to perform statistical calculations on numeric fields and compare field values against these calculated statistics. These functions are useful for identifying outliers, finding issues above or below certain thresholds, and performing statistical analysis on your issue data.
Functions
min
Returns the minimum value of a numeric field from issues matching the specified JQL subquery.
Syntax:
"field_name" operator min("subquery")
Parameters:
- subquery (required): A valid JQL query that defines the set of issues to evaluate
Example:
"Story Points" > min("project = DEVELOPMENT")
Finds all issues where Story Points is greater than the minimum Story Points value in the DEVELOPMENT project.
max
Returns the maximum value of a numeric field from issues matching the specified JQL subquery.
Syntax:
"field_name" operator max("subquery")
Parameters:
- subquery (required): A valid JQL query that defines the set of issues to evaluate
Example:
"Story Points" < max("project = DEVELOPMENT")
Finds all issues where Story Points is less than the maximum Story Points value in the DEVELOPMENT project.
avg
Returns the average (mean) value of a numeric field from issues matching the specified JQL subquery.
Syntax:
"field_name" operator avg("subquery")
Parameters:
- subquery (required): A valid JQL query that defines the set of issues to evaluate
Example:
"Story Points" > avg("project = DEVELOPMENT")
Finds all issues where Story Points is greater than the average Story Points value in the DEVELOPMENT project.
Supported Operators
All math functions support: =, !=, >, >=, <, <=
Examples
Finding issues with story points above project average
"Story Points" > avg("project = DEVELOPMENT")
Finding issues with story points below project maximum
"Story Points" < max("project = DEVELOPMENT")
Finding issues with story points equal to project minimum
"Story Points" = min("project = DEVELOPMENT")
Finding issues with story points above average in a specific component
"Story Points" > avg("component = 'Frontend'")
Finding issues with effort above average for high-priority issues
"Effort" > avg("priority = High")
Finding issues with story points above average of completed issues
"Story Points" > avg("status = Done")
Usage Notes
- These functions work exclusively with numeric fields (number fields, story points, etc.)
- Results are calculated in real-time based on current field values
- Empty field values are excluded from calculations
- Function names should not be quoted: use
min,max,avgdirectly
Performance Considerations
- Large subqueries may impact performance; use specific filters when possible
- Use
IS NOT EMPTYfilters in subqueries to reduce the number of issues processed - Statistics are calculated in real-time, so changes to field values immediately affect query results
Error Handling
The functions will return an error if:
- The specified field name is not valid or not a numeric field
- The JQL subquery is invalid or returns no results
- All issues in the subquery have empty values for the field being calculated