Use case

Return the number of components of the issue.

Expression

Create and configure a Smart field using this expression in Jira expression mode:

issue.components.length