I am trying to set Fix Version and Custom Field "Team Codes" when a sub-task is created. I have an Issue of Type PTR and I go to More -> Create sub-task. The PTR has Team Codes and Fix Version fields defined. As a test, I am using the the example script from Script Runner with the single change of modifying List copyCustomFields = ["Team Codes"]. I threw some log.error("blah") to see where it was existing and it's inside this if-statement:
if (!parentIssueId || underlyingIssue) {
// this is not a subtask, or issue already exists, so don't set default values
return
}
Because it's exiting early, it doesn't perform any of the copy of the fields. I have the script-runner as a post-function in the create transition. I also tried moving the function from the top of the post-functions to the bottom that didn't change anything (I didn't expect it to...).
Any ideas?