Use case
Return the remaining budget after deducting the expenses of the sub-tasks to the budget of the task. The expenses and budget are represented in different Number custom fields.
Expression
Create and configure a Smart field using this expression in General parsing mode:
%{{issue.cfnnnnn} = null ? null : {issue.cfnnnnn} - sum(append(fieldValue({issue.cfppppp}, subtasks()), [0]))}
Please, replace nnnnn with the ID of the Number custom field for the budget and ppppp with the ID for the Number custom field for the expenses in the above expression.