Currently I found a way in the forum to prevent closing of epic if stories linked to it aren't closed. I'm trying to achieve the same but "Task" instead of stories linked to an epic must close for the epic to transit to closed status, using script runner.
Answers are welcome, even If it's possible using automation for JIRA.