I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

      rocketSend(
          channel: 'notification-channel',
          message: "[Click here](http://www.example.com?param1=value1&param2=value2&param3=value3)",
          rawMessage: true
      )

      However, despite having set rawMessage: true, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

      Thus in the above case, the body received will be

      [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3) 
      

      instead of being

      [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3)

       

          [JENKINS-54091] Messages with ampersands are HTML escaped

          Adarsh Ramamurthy created issue -
          Adarsh Ramamurthy made changes -
          Description Original: I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

          {{rocketSend(}}
          {{    channel: 'notification-channel',}}
          {{    message: "[Click here](http://www.example.com?param1=value1&param2=value2&param3=value3)",}}
          {{    rawMessage: true}}
          {{)}}

          However, despite having set rawMessage: true, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

          Thus in the above case, the body received will be

          {{[Click here](http://www.example.com?param1=value1&param2=value2&param3=value3)}}

          instead of being

          {{[Click here](http://www.example.com?param1=value1&param2=value2&param3=value3)}}

           
          New: I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

          {{rocketSend(}}
           {{    channel: 'notification-channel',}}
           {{    message: "[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])",}}
           {{    rawMessage: true}}
           {{)}}

          However, despite having set {{rawMessage: true}}, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

          Thus in the above case, the body received will be

          {{[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])}}

          instead of being

          {{[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])}}

           
          Adarsh Ramamurthy made changes -
          Summary Original: Unable to send messages containing ampersand character New: Messages with ampersands are HTML escaped

          which version of the plugin and of rocket you're using?

          Martin Reinhardt added a comment - which version of the plugin and of rocket you're using?
          Martin Reinhardt made changes -
          Assignee Original: Martin Reinhardt [ mreinhardt ] New: Adarsh Ramamurthy [ adarshr ]
          Martin Reinhardt made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Hi mreinhardt, I'm using Rocket.Chat v2.15.0 and the Jenkins plugin is 0.5.2

          Adarsh Ramamurthy added a comment - Hi mreinhardt , I'm using Rocket.Chat v2.15.0 and the Jenkins plugin is 0.5.2
          Adarsh Ramamurthy made changes -
          Description Original: I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

          {{rocketSend(}}
           {{    channel: 'notification-channel',}}
           {{    message: "[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])",}}
           {{    rawMessage: true}}
           {{)}}

          However, despite having set {{rawMessage: true}}, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

          Thus in the above case, the body received will be

          {{[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])}}

          instead of being

          {{[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])}}

           
          New: I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

          {{rocketSend(}}
           {{    channel: 'notification-channel',}}
           {{    message: "[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])",}}
           {{    rawMessage: true}}
           {{)}}

          However, despite having set {{rawMessage: true}}, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

          Thus in the above case, the body received will be

           
          {code:java}
          [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3) 
          {code}
          instead of being
          {code:java}
          [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3){code}
           
          Adarsh Ramamurthy made changes -
          Description Original: I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

          {{rocketSend(}}
           {{    channel: 'notification-channel',}}
           {{    message: "[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])",}}
           {{    rawMessage: true}}
           {{)}}

          However, despite having set {{rawMessage: true}}, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

          Thus in the above case, the body received will be

           
          {code:java}
          [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3) 
          {code}
          instead of being
          {code:java}
          [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3){code}
           
          New: I am trying to send some messages using the Rocket.Chat notifier plugin that contains special characters such as ampersands. I use the Jenkins declarative pipeline syntax for this and the below snippet.

          {{rocketSend(}}
           {{    channel: 'notification-channel',}}
           {{    message: "[Click here]([http://www.example.com?param1=value1&param2=value2&param3=value3|http://www.example.com/?param1=value1&param2=value2&param3=value3])",}}
           {{    rawMessage: true}}
           {{)}}

          However, despite having set {{rawMessage: true}}, the messages that are received have all & characters HTML escaped into & causing any links containing query parameters in the message body to be broken.

          Thus in the above case, the body received will be
          {code:java}
          [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3) 
          {code}
          instead of being
          {code:java}
          [Click here](http://www.example.com?param1=value1&param2=value2&param3=value3){code}
           

          really sure? RocketChat latest release version is 0.74.3: https://github.com/RocketChat/Rocket.Chat/releases/tag/0.74.3
          and latest plugin is 1.4.3.

          Could you check with latest plugin version, at least

          Martin Reinhardt added a comment - really sure? RocketChat latest release version is 0.74.3: https://github.com/RocketChat/Rocket.Chat/releases/tag/0.74.3 and latest plugin is 1.4.3. Could you check with latest plugin version, at least

            adarshr Adarsh Ramamurthy
            adarshr Adarsh Ramamurthy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: