Skip to main content

fieldCount

Overview

The fieldCount function allows you to count occurrences of a specified field or property (such as attachments, worklogs, comments) within issues and filter based on that count.

Syntax

issue operator fieldCount("subquery", "fieldName", count)

Parameters

  • subquery (required): A valid JQL query that defines the set of issues to evaluate
  • fieldName (required): The name of the field or property to count
  • count (required): The number of occurrences to compare against

Supported Operators

=, !=, >, >=, <, <=

Countable Fields and Properties

  • Standard fields: labels, assignee, components, fixVersions, affectedVersions
  • Non-field properties: attachments, worklogs, comments
  • Custom fields: Any multi-value custom field

Examples

Finding issues with exactly 3 labels

issue = fieldCount("project = CITEST", "labels", 3)

Finding issues with a parent

issue > fieldCount("project = CITEST", "Parent", 0)

Finding issues with an assignee

issue = fieldCount("project = CITEST", "assignee", 1)

Finding issues with 2 or more attachments

issue >= fieldCount("project = CITEST", "attachments", 2)

Finding issues with worklogs

issue > fieldCount("project = CITEST", "worklogs", 0)

Finding issues with at least 2 comments

issue >= fieldCount("project = CITEST", "comments", 2)

Performance Considerations

  • The function evaluates each issue in the subquery, so use specific subqueries for better performance
  • Counting properties like worklogs and comments may take longer than counting simple fields

Error Handling

The function will return an error if:

  • The specified field name is not valid
  • The JQL subquery is invalid
  • The count value is not a valid number