The usual thing to do is have a workflow for the main issue that includes a condition "can not close this issue when it has open sub-tasks". That condition is a standard one available in JIRA off-the-shelf. A second option is in JIRA Software - a main issue can be moved to done when its last sub-task is closed.
With a little bit of code (provided by add-ons), there are variants - automatically transitioning sub-tasks when a main issue changes, or changing issues based on issue links rather than sub-tasks.
Edit the workflow for Task 1, and look at the "conditions" on the transition into "done". You will want to add the "sub task blocking" condition to it (you don't need to worry about the sub-task workflow having this condition, or if there are no sub-tasks on a parent - if there are no sub-tasks, it won't block anything)
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs