Transcripts of noxious stimulus-detecting TrpA1 channels are alternatively spliced. Despite the importance of nociception for survival, the in vivo significance of expressing different TrpA1 isoforms is largely unknown. Here, we develop a novel genetic approach to generate Drosophila knockin strains expressing single TrpA1 isoforms. Drosophila TrpA1 mediates heat and UVC-triggered nociception. We show that TrpA1-C and TrpA1-D, two alternative isoforms, are co-expressed in nociceptors. When examined in heterologous cells, both TrpA1-C and TrpA1-D are activated by heat and UVC. By contrast, analysis of knockin flies reveals the striking functional specificity; TrpA1-C mediates UVC-nociception, whereas TrpA1-D mediates heat-nociception. Therefore, in vivo functions of TrpA1-C and TrpA1-D are different from each other and are different from their in vitro properties. Our results indicate that a given sensory stimulus preferentially activates a single TrpA1 isoform in vivo and that polymodal nociception requires co-expression of TrpA1 isoforms, providing novel insights of how alternative splicing regulates nociception.