I suppose that you have one issue task called "Sub-task" and you want to restrict its creation only to "Task" parent issue types. In that case you have to add validator to transition "Create Issue" of the workflow used by "Sub-task", with the following configuration:
Text to be parsed is: %{00014} = "Sub-task" IMPLIES %{00040} = "Task"
Note that:
Once configured, transition Create Issue will look like this:
%{00041} = null IMPLIES %{00040} not in ["Bug", "Enhancement"]
being %{00041} field code for field "Parent's issue key"
an equivalent expression without using connective IMPLIES and operator NOT IN:
%{00041} != null OR %{00040} != "Bug" AND %{00040} != "Enhancement"
%{00014} = "Sub-task" IMPLIES %{00040} not in ["Bug", "Enhancement"]
or an equivalent expression without using connective IMPLIES and operator NOT IN:
%{00041} != "Sub-task" OR %{00040} != "Bug" AND %{00040} != "Enhancement"
(%{00014} = "Sub-task" IMPLIES %{00040} in ["Task"]) AND (%{00014} = "Agile Sub-task" IMPLIES %{00040} in ["Story", "Epic"])
or an equivalent expression without using connective IMPLIES and operator IN:
(%{00014} != "Sub-task" OR %{00040} = "Task") AND (%{00014} != "Agile Sub-task" OR %{00040} = "Epic" OR %{00040} = "Story")