I'm trying to set up a post-function that creates sub-tasks when the component is something specific. I'm finding some examples of figuring out the project lead etc but not component name itself. Anyone have anything working they could share? 
The goal would be to add this to the create -step. I was going along the lines of...
def components = issue.getComponents()
cfValues['Task Type']?.value == 'Definition' && issue.projectObject.key in ["TEST"] && components.contains('W_Migration')
But this obviously doesn't work. It validates in ScriptRunner but nothing happens in transition (either in create or anywhere else).
Any assistance is greatly appreciated 