Jenkins facing issue while reading the groovy script

I am using groovy script in jenkins and passing the values in key pair format.
e.g ‘xyz@gmail.com’:‘xyz’

But jenkins throwing an error as:

Error 400: Field notification_channel.labels[email_address] had an invalid value of “xyz@gmail.com”: Value does not match the regular expression “[1]+@[^\s,@]+$”.e[0m


  1. ^\s,@ ↩︎

Could you share the pipeline code?

The groovy script i am using is in this format
return [‘xyz@gmail.com’:‘xyz’,‘abc@gmail.com’:‘abc’]

Here I am adding this mail as notification channel for any VM instance and I am managing this using terraform script.

But while running the script with Jenkins I am getting this error:

google_monitoring_notification_channel.basice[0m will be created

e[0m e[32m+e[0me[0m resource “google_monitoring_notification_channel” “basic” {
e[32m+e[0me[0m display_name = “abc@gmail.com”
e[32m+e[0me[0m enabled = true
e[32m+e[0me[0m force_delete = false
e[32m+e[0me[0m id = (known after apply)
e[32m+e[0me[0m labels = {
e[32m+e[0me[0m “email_address” = “abc@gmail.com”
}
e[32m+e[0me[0m name = (known after apply)
e[32m+e[0me[0m project = (known after apply)
e[32m+e[0me[0m type = “email”
e[32m+e[0me[0m verification_status = (known after apply)
}

e[1mPlan:e[0m 1 to add, 0 to change, 0 to destroy.
e[0me[0me[1mgoogle_monitoring_notification_channel.basic: Creating…e[0me[0m
e[31m╷e[0me[0m
e[31m│e[0m e[0me[1me[31mError: e[0me[0me[1mError creating NotificationChannel: googleapi: Error 400: Field notification_channel.labels[email_address] had an invalid value of “abc@gmail.com”: Value does not match the regular expression “[1]+@[^\s,@]+$”.e[0m

In short the jenkins reading the ‘@’ as ‘@’ in its XML format.


  1. ^\s,@ ↩︎

This is the exact issue

The jenkins reading the ‘@’ symbol in its XML format.