Use case
Return the sum of the story points of the child issues in any status with the status category Done.
Expression
Create and configure a Smart field using this expression in General parsing mode:
%{sum(fieldValue({issue.cfnnnnn},issuesFromJQL("statusCategory = Done AND 'parent' = "+%{issue.key})))}
Replace "nnnnn" with the ID of the story points field. Keep in mind, that this smart fields should be displayed on a parent issue.