Write plugin automation when controlled via MIDI?

When I put a plugin control into “write” mode and manually move the slider around, it writes to the automation track just fine, but when I control the plugin via MIDI the changes are not recorded. MIDI control of pan and gain are recorded correctly. Is there a way to make this work for plugins? I couldn’t find a bug report relating specifically to this in Mantis. Thanks for any info.