Use case

Return the number of sub-tasks.

Expression

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

%{issue.subtasks.length}