Hi everyone!
I need to create an automation for HR department based on the following task:
"We request that once the last cloned “children” ticket is closed, the “parent” ticket be automatically closed in JIRA"

I tried to use the standard script to close the main task when all the subtasks are closed, but it doesn't work in this case. Also here is the workflow for this project. I added a transition from "Hr validation" to Closed to make the automation work in this case. As a condition, he indicated that the transition to closed can only be as indicated on the screen.

Can you please help with what needs to be fixed or redone?