You may use a special template if you need to close the parent issue if all subtasks are done.
When you select a template then it starts new automation with a filled-in answer for the automation name, trigger, condition, and action that accomplishes a specific use case. You'll see "Related compare condition" values in fields. The trigger is "Issue Transitioned" and the action is "Close parent issue".
Enter the automation name and select the project. Don't forget to enable your automation.
When trigger and condition will fire then action will happen on the board.
Try the Automation Unlimited for Jira for free on the Atlassian Marketplace.