I am using the the Jira plugin, groovyrunner, which has several built in scripts. One of which is a script listener which runs a built-in script when a certain project fires a specific event. In this case, the script is 'Create a sub-task'. You can run additional code after you select a few settings and possibly constraints. I have it so the assignee is set when the sub-task is created. Now what I want to do is set the component for the sub-task. Currently, it uses the the parent components, which I don't want.
Originally I was trying to use:
issue.setComponentIds('idnum')
but now I just found this:
setComponentObjects(Collection<ProjectComponent> components)
at http://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/MutableIssue.html
I am just having trouble making the leap to contructing the ProjectComponent with a component id and inserting it into the Collection.