If you are on Jira Cloud then you can make use of Automations like this. Add a trigger to the parent issue and copy fields from the parent while creating subtasks only.
If you still want to proceed with Scriptrunner then you need to make rest calls, this can help you REST APIs (adaptavist.com)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.